![]() |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
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 31 of file allocators.h.
|
private |
Definition at line 103 of file allocators.h.
|
inline |
Definition at line 34 of file allocators.h.
|
inline |
Definition at line 41 of file allocators.h.
|
inline |
Definition at line 92 of file allocators.h.
|
inline |
|
inline |
|
private |
Definition at line 104 of file allocators.h.
|
private |
Definition at line 99 of file allocators.h.
|
private |
Definition at line 100 of file allocators.h.
|
private |
Definition at line 101 of file allocators.h.
|
private |
Definition at line 101 of file allocators.h.
1.8.17