Changeset View
Changeset View
Standalone View
Standalone View
src/support/lockedpool.h
Show All 16 Lines | |||||
* Abstract base class. | * Abstract base class. | ||||
*/ | */ | ||||
class LockedPageAllocator { | class LockedPageAllocator { | ||||
public: | public: | ||||
virtual ~LockedPageAllocator() {} | virtual ~LockedPageAllocator() {} | ||||
/** | /** | ||||
* Allocate and lock memory pages. | * Allocate and lock memory pages. | ||||
* If len is not a multiple of the system page size, it is rounded up. | * If len is not a multiple of the system page size, it is rounded up. | ||||
* Returns 0 in case of allocation failure. | * Returns nullptr in case of allocation failure. | ||||
* | * | ||||
* If locking the memory pages could not be accomplished it will still | * If locking the memory pages could not be accomplished it will still | ||||
* return the memory, however the lockingSuccess flag will be false. | * return the memory, however the lockingSuccess flag will be false. | ||||
* lockingSuccess is undefined if the allocation fails. | * lockingSuccess is undefined if the allocation fails. | ||||
*/ | */ | ||||
virtual void *AllocateLocked(size_t len, bool *lockingSuccess) = 0; | virtual void *AllocateLocked(size_t len, bool *lockingSuccess) = 0; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 221 Lines • Show Last 20 Lines |