|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
40 #ifndef OGDF_MEMORY_POOL_NTS
121 #ifndef OGDF_MEMORY_POOL_NTS
127 #ifndef OGDF_MEMORY_POOL_NTS
163 #ifdef OGDF_MEMORY_POOL_NTS
The namespace for all OGDF objects.
static void deallocateList(size_t nBytes, void *pHead, void *pTail)
Deallocate a complete list starting at pHead and ending at pTail.
static int slicesPerBlock(uint16_t nBytes, int &nWords)
Basic memory element used to realize a linked list of deallocated memory segments.
static size_t memoryInThreadFreeList()
Returns the total amount of memory (in bytes) available in the thread's free lists.
static void defrag()
Defragments the global free lists.
static thread_local long long s_locallyAllocatedBytes
Holds the number of thread-locally allocated bytes for debugging.
static MemElemPtr allocateBlock()
static void * allocate(size_t nBytes)
Allocates memory of size nBytes.
static size_t memoryInGlobalFreeList()
Returns the total amount of memory (in bytes) available in the global free lists.
static size_t memoryAllocatedInBlocks()
Returns the total amount of memory (in bytes) allocated from the system.
static void makeSlices(MemElemPtr p, int nWords, int nSlices)
static void deallocate(size_t nBytes, void *p)
Deallocates memory at address p which is of size nBytes.
#define OGDF_SIZEOF_POINTER
The size of a pointer.
static void cleanup()
Frees all allocated memory.
static constexpr size_t TABLE_SIZE
static size_t unguardedMemGlobalFreelist()
static long long s_globallyAllocatedBytes
Holds the number of globally allocated bytes for debugging.
static int slicesPerBlock(uint16_t nBytes)
static std::mutex s_mutex
Allocates memory in large chunks for better runtime.
static void flushPool()
Flushes all free but allocated bytes (s_tp) to the thread-global list (s_pool) of allocated bytes.
static constexpr size_t BLOCK_SIZE
Basic declarations, included by all source files.
static void * fillPool(MemElemPtr &pFreeBytes, uint16_t nBytes)
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
static thread_local MemElemPtr s_tp[TABLE_SIZE]
Contains the allocated but free memory for a single thread.
static BlockChain * s_blocks
Holds all allocated memory independently of whether it is cleared in chunks of size BLOCK_SIZE.
static PoolElement s_pool[TABLE_SIZE]
Contains allocated but free memory that may be used by all threads. Filled upon exiting a thread that...
static bool checkSize(size_t nBytes)
Returns true iff allocate can be invoked with nBytes.
static constexpr size_t MIN_BYTES