#include <FXProcess.h>
This little class for the duration of its existence locks a range of a process' address space into memory, thus preventing it from being paged out. This can be useful when utmost performance is required or more likely to prevent secure data from being leaked. The FX::Secure namespace heap manages one of these automatically.
What you specify to this class at construction and what actually gets locked can vary, not least because locking is done in units of FX::FXProcess::pageSize(). You can determine what pages are locked at any given time using FX::FXProcess::lockedPages(). Nested locks across multiple threads are fine eg;
FXProcess_LockMem h1(ptr, 16384); // Thread 1 FXProcess_LockMem h2(ptr+4096, 32768); // Thread 2 delete h1; // Thread 1
Public Member Functions | |
FXProcess_MemLock () | |
FXProcess_MemLock (void *startaddr, FXuval length) | |
FXProcess_MemLock (const FXProcess_MemLock &o) | |
FXProcess_MemLock & | operator= (const FXProcess_MemLock &o) |
void * | location () const throw () |
FXuval | length () const throw () |
FX::FXProcess_MemLock::FXProcess_MemLock | ( | ) | [inline] |
Creates a null lock.
FX::FXProcess_MemLock::FXProcess_MemLock | ( | void * | startaddr, | |
FXuval | length | |||
) | [inline] |
Creates an instance locking the specified region.
void* FX::FXProcess_MemLock::location | ( | ) | const throw () [inline] |
Returns the start of the locked region.
FXuval FX::FXProcess_MemLock::length | ( | ) | const throw () [inline] |
Returns the length of the locked region.