![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
Thread-safe class to keep track of locked (ie, non-swappable) memory pages. More...
#include <allocators.h>
Public Member Functions | |
LockedPageManagerBase (size_t page_size) | |
~LockedPageManagerBase () | |
void | LockRange (void *p, size_t size) |
void | UnlockRange (void *p, size_t size) |
int | GetLockedPageCount () |
Private Types | |
typedef std::map< size_t, int > | Histogram |
Private Attributes | |
Locker | locker |
boost::mutex | mutex |
size_t | page_size |
size_t | page_mask |
Histogram | histogram |
Thread-safe class to keep track of locked (ie, non-swappable) memory pages.
Memory locks do not stack, that is, pages which have been locked several times by calls to mlock() will be unlocked by a single call to munlock(). This can result in keying material ending up in swap when those functions are used naively. This class simulates stacking memory locks by keeping a counter per page.
Definition at line 28 of file allocators.h.
|
private |
Definition at line 103 of file allocators.h.
|
inline |
Definition at line 31 of file allocators.h.
|
inline |
Definition at line 39 of file allocators.h.
|
inline |
Definition at line 92 of file allocators.h.
Referenced by LockedPageManagerBase< MemoryPageLocker >::~LockedPageManagerBase().
|
inline |
Definition at line 46 of file allocators.h.
Referenced by secure_allocator< T >::allocate(), CCrypter::CCrypter(), and LockObject().
|
inline |
Definition at line 69 of file allocators.h.
Referenced by secure_allocator< T >::deallocate(), UnlockObject(), and CCrypter::~CCrypter().
|
private |
Definition at line 104 of file allocators.h.
Referenced by LockedPageManagerBase< MemoryPageLocker >::GetLockedPageCount(), LockedPageManagerBase< MemoryPageLocker >::LockRange(), and LockedPageManagerBase< MemoryPageLocker >::UnlockRange().
|
private |
Definition at line 99 of file allocators.h.
Referenced by LockedPageManagerBase< MemoryPageLocker >::LockRange(), and LockedPageManagerBase< MemoryPageLocker >::UnlockRange().
|
private |
Definition at line 100 of file allocators.h.
Referenced by LockedPageManagerBase< MemoryPageLocker >::GetLockedPageCount(), LockedPageManagerBase< MemoryPageLocker >::LockRange(), and LockedPageManagerBase< MemoryPageLocker >::UnlockRange().
|
private |
Definition at line 101 of file allocators.h.
Referenced by LockedPageManagerBase< MemoryPageLocker >::LockedPageManagerBase(), LockedPageManagerBase< MemoryPageLocker >::LockRange(), and LockedPageManagerBase< MemoryPageLocker >::UnlockRange().
|
private |
Definition at line 101 of file allocators.h.
Referenced by LockedPageManagerBase< MemoryPageLocker >::LockRange(), and LockedPageManagerBase< MemoryPageLocker >::UnlockRange().