Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
lockedpool.h
Go to the documentation of this file.
153 explicit LockedPool(std::unique_ptr<LockedPageAllocator> allocator, LockingFailed_Callback lf_cb_in = nullptr);
Arena & operator=(const Arena &)=delete
bool(* LockingFailed_Callback)()
Callback when allocation succeeds but locking fails.
Definition: lockedpool.h:133
std::mutex mutex
Mutex protects access to this pool's data structures, including arenas.
Definition: lockedpool.h:195
static LockedPoolManager & Instance()
Return the current instance, or create it once.
Definition: lockedpool.h:213
virtual void * AllocateLocked(size_t len, bool *lockingSuccess)=0
Allocate and lock memory pages.
LockedPool(std::unique_ptr< LockedPageAllocator > allocator, LockingFailed_Callback lf_cb_in=nullptr)
Create a new LockedPool.
Definition: lockedpool.cpp:261
LockedPageArena(LockedPageAllocator *alloc_in, void *base_in, size_t size, size_t align)
Definition: lockedpool.cpp:349
OS-dependent allocation and deallocation of locked/pinned memory pages.
Definition: lockedpool.h:18
bool addressInArena(void *ptr) const
Return whether a pointer points inside this arena.
Definition: lockedpool.h:89
Singleton class to keep track of locked (ie, non-swappable) memory, for use in std::allocator templat...
Definition: lockedpool.h:209
virtual void FreeLocked(void *addr, size_t len)=0
Unlock and free memory pages.
static bool LockingFailed()
Called when locking fails, warn the user here.
Definition: lockedpool.cpp:366
virtual size_t GetLimit()=0
Get the total limit on the amount of memory that may be locked by this process, in bytes...
LockedPoolManager(std::unique_ptr< LockedPageAllocator > allocator)
Definition: lockedpool.cpp:361
static void CreateInstance()
Create a new LockedPoolManager specialized to the OS.
Definition: lockedpool.cpp:372
Definition: lockedpool.h:47
std::map< char *, size_t > chunks_free
Map of chunk address to chunk information.
Definition: lockedpool.h:94
LockedPool & operator=(const LockedPool &)=delete