![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
Singleton class to keep track of locked (ie, non-swappable) memory pages, for use in std::allocator templates. More...
#include <allocators.h>
Static Public Member Functions | |
static LockedPageManager & | Instance () |
Private Member Functions | |
LockedPageManager () | |
Static Private Member Functions | |
static void | CreateInstance () |
Static Private Attributes | |
static LockedPageManager * | _instance = NULL |
static boost::once_flag | init_flag = BOOST_ONCE_INIT |
Additional Inherited Members | |
![]() | |
LockedPageManagerBase (size_t page_size) | |
~LockedPageManagerBase () | |
void | LockRange (void *p, size_t size) |
void | UnlockRange (void *p, size_t size) |
int | GetLockedPageCount () |
Singleton class to keep track of locked (ie, non-swappable) memory pages, for use in std::allocator templates.
Some implementations of the STL allocate memory in some constructors (i.e., see MSVC's vector<T> implementation where it allocates 1 byte of memory in the allocator.) Due to the unpredictable order of static initializers, we have to make sure the LockedPageManager instance exists before any other STL-based objects that use secure_allocator are created. So instead of having LockedPageManager also be static-intialized, it is created on demand.
Definition at line 136 of file allocators.h.
|
private |
Definition at line 64 of file allocators.cpp.
|
inlinestaticprivate |
Definition at line 148 of file allocators.h.
References _instance.
Referenced by Instance().
|
inlinestatic |
Definition at line 139 of file allocators.h.
References _instance, CreateInstance(), and init_flag.
Referenced by secure_allocator< T >::allocate(), CCrypter::CCrypter(), secure_allocator< T >::deallocate(), LockObject(), UnlockObject(), and CCrypter::~CCrypter().
|
staticprivate |
Definition at line 159 of file allocators.h.
Referenced by CreateInstance(), and Instance().
|
staticprivate |
Definition at line 160 of file allocators.h.
Referenced by Instance().