Anoncoin  0.9.4
P2P Digital Currency
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
LockedPageManager Class Reference

Singleton class to keep track of locked (ie, non-swappable) memory pages, for use in std::allocator templates. More...

#include <allocators.h>

Inheritance diagram for LockedPageManager:
[legend]
Collaboration diagram for LockedPageManager:
[legend]

Static Public Member Functions

static LockedPageManagerInstance ()
 

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

- Public Member Functions inherited from LockedPageManagerBase< MemoryPageLocker >
 LockedPageManagerBase (size_t page_size)
 
 ~LockedPageManagerBase ()
 
void LockRange (void *p, size_t size)
 
void UnlockRange (void *p, size_t size)
 
int GetLockedPageCount ()
 

Detailed Description

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 137 of file allocators.h.

Constructor & Destructor Documentation

LockedPageManager::LockedPageManager ( )
private

Definition at line 65 of file allocators.cpp.

Member Function Documentation

static void LockedPageManager::CreateInstance ( )
inlinestaticprivate

Definition at line 149 of file allocators.h.

Here is the caller graph for this function:

static LockedPageManager& LockedPageManager::Instance ( )
inlinestatic

Definition at line 140 of file allocators.h.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

LockedPageManager * LockedPageManager::_instance = NULL
staticprivate

Definition at line 160 of file allocators.h.

boost::once_flag LockedPageManager::init_flag = BOOST_ONCE_INIT
staticprivate

Definition at line 161 of file allocators.h.


The documentation for this class was generated from the following files: