Implements a simple memory manager using malloc()
and free()
.
More...
#include <ogdf/basic/memory/MallocMemoryAllocator.h>
Classes | |
struct | MemElem |
Public Member Functions | |
MallocMemoryAllocator () | |
~MallocMemoryAllocator () | |
Static Public Member Functions | |
static void * | allocate (size_t nBytes) |
Allocates memory of size nBytes . | |
static void * | allocate (size_t nBytes, const char *, int) |
Allocates memory of size nBytes . | |
static constexpr bool | checkSize (size_t) |
Always returns true since we simply trust malloc(). | |
static void | cleanup () |
static void | deallocate (size_t, void *p) |
Deallocates memory at address p . We do not keep track of the size of the deallocated object. | |
static void | deallocateList (size_t, void *pHead, void *pTail) |
Deallocate a complete list starting at pHead and ending at pTail . | |
static void | flushPool () |
static void | flushPool (uint16_t) |
static constexpr size_t | memoryAllocatedInBlocks () |
Always returns 0, since no blocks are allocated. | |
static constexpr size_t | memoryInFreelist () |
Always returns 0, since no blocks are allocated. | |
static constexpr size_t | memoryInGlobalFreeList () |
Always returns 0, since no blocks are allocated. | |
static constexpr size_t | memoryInThreadFreeList () |
Always returns 0, since no blocks are allocated. | |
Private Types | |
using | MemElemPtr = MemElem * |
Implements a simple memory manager using malloc()
and free()
.
Definition at line 41 of file MallocMemoryAllocator.h.
|
private |
Definition at line 46 of file MallocMemoryAllocator.h.
|
inline |
Definition at line 49 of file MallocMemoryAllocator.h.
|
inline |
Definition at line 51 of file MallocMemoryAllocator.h.
Allocates memory of size nBytes
.
Definition at line 59 of file MallocMemoryAllocator.h.
|
inlinestatic |
Allocates memory of size nBytes
.
Definition at line 56 of file MallocMemoryAllocator.h.
Always returns true since we simply trust malloc().
Definition at line 89 of file MallocMemoryAllocator.h.
Definition at line 53 of file MallocMemoryAllocator.h.
Deallocates memory at address p
. We do not keep track of the size of the deallocated object.
Definition at line 69 of file MallocMemoryAllocator.h.
|
inlinestatic |
Deallocate a complete list starting at pHead
and ending at pTail
.
The elements are assumed to be chained using the first word of each element.
Definition at line 75 of file MallocMemoryAllocator.h.
Definition at line 84 of file MallocMemoryAllocator.h.
Definition at line 86 of file MallocMemoryAllocator.h.
|
inlinestaticconstexpr |
Always returns 0, since no blocks are allocated.
Definition at line 92 of file MallocMemoryAllocator.h.
Always returns 0, since no blocks are allocated.
Definition at line 95 of file MallocMemoryAllocator.h.
|
inlinestaticconstexpr |
Always returns 0, since no blocks are allocated.
Definition at line 98 of file MallocMemoryAllocator.h.
|
inlinestaticconstexpr |
Always returns 0, since no blocks are allocated.
Definition at line 101 of file MallocMemoryAllocator.h.