Bitcoin ABC 0.26.3
P2P Digital Currency
|
LockedPageAllocator specialized for OSes that don't try to be special snowflakes. More...
Public Member Functions | |
PosixLockedPageAllocator () | |
void * | AllocateLocked (size_t len, bool *lockingSuccess) override |
Allocate and lock memory pages. | |
void | FreeLocked (void *addr, size_t len) override |
Unlock and free memory pages. | |
size_t | GetLimit () override |
Get the total limit on the amount of memory that may be locked by this process, in bytes. | |
Public Member Functions inherited from LockedPageAllocator | |
virtual | ~LockedPageAllocator () |
Private Attributes | |
size_t | page_size |
LockedPageAllocator specialized for OSes that don't try to be special snowflakes.
Definition at line 223 of file lockedpool.cpp.
PosixLockedPageAllocator::PosixLockedPageAllocator | ( | ) |
|
overridevirtual |
Allocate and lock memory pages.
If len is not a multiple of the system page size, it is rounded up. Returns nullptr in case of allocation failure.
If locking the memory pages could not be accomplished it will still return the memory, however the lockingSuccess flag will be false. lockingSuccess is undefined if the allocation fails.
Implements LockedPageAllocator.
Definition at line 249 of file lockedpool.cpp.
Unlock and free memory pages.
Clear the memory before unlocking.
Implements LockedPageAllocator.
Definition at line 268 of file lockedpool.cpp.
|
overridevirtual |
Get the total limit on the amount of memory that may be locked by this process, in bytes.
Return size_t max if there is no limit or the limit is unknown. Return 0 if no memory can be locked at all.
Implements LockedPageAllocator.
Definition at line 274 of file lockedpool.cpp.
|
private |
Definition at line 231 of file lockedpool.cpp.