Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

PosixLockedPageAllocator Class Reference

LockedPageAllocator specialized for OSes that don't try to be special snowflakes. More...

+ Inheritance diagram for PosixLockedPageAllocator:
+ Collaboration diagram for PosixLockedPageAllocator:

Public Member Functions

 PosixLockedPageAllocator ()
 
void * AllocateLocked (size_t len, bool *lockingSuccess) override
 Allocate and lock memory pages. More...
 
void FreeLocked (void *addr, size_t len) override
 Unlock and free memory pages. More...
 
size_t GetLimit () override
 Get the total limit on the amount of memory that may be locked by this process, in bytes. More...
 
- Public Member Functions inherited from LockedPageAllocator
virtual ~LockedPageAllocator ()
 

Private Attributes

size_t page_size
 

Detailed Description

LockedPageAllocator specialized for OSes that don't try to be special snowflakes.

Definition at line 200 of file lockedpool.cpp.

Constructor & Destructor Documentation

◆ PosixLockedPageAllocator()

PosixLockedPageAllocator::PosixLockedPageAllocator ( )

Definition at line 211 of file lockedpool.cpp.

References page_size.

Member Function Documentation

◆ AllocateLocked()

void * PosixLockedPageAllocator::AllocateLocked ( size_t  len,
bool *  lockingSuccess 
)
overridevirtual

Allocate and lock memory pages.

If len is not a multiple of the system page size, it is rounded up. Returns 0 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 227 of file lockedpool.cpp.

References align_up(), MAP_ANONYMOUS, and page_size.

◆ FreeLocked()

void PosixLockedPageAllocator::FreeLocked ( void *  addr,
size_t  len 
)
overridevirtual

Unlock and free memory pages.

Clear the memory before unlocking.

Implements LockedPageAllocator.

Definition at line 237 of file lockedpool.cpp.

References align_up(), memory_cleanse(), and page_size.

◆ GetLimit()

size_t PosixLockedPageAllocator::GetLimit ( )
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 244 of file lockedpool.cpp.

Member Data Documentation

◆ page_size

size_t PosixLockedPageAllocator::page_size
private

Definition at line 208 of file lockedpool.cpp.

Referenced by AllocateLocked(), FreeLocked(), and PosixLockedPageAllocator().


The documentation for this class was generated from the following file:
Released under the MIT license