Implements a simple memory manager using malloc()
and free()
.
More...
#include <ogdf/basic/memory/MallocMemoryAllocator.h>
|
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.
|
|
Implements a simple memory manager using malloc()
and free()
.
Definition at line 44 of file MallocMemoryAllocator.h.
◆ MemElemPtr
◆ MallocMemoryAllocator()
ogdf::MallocMemoryAllocator::MallocMemoryAllocator |
( |
| ) |
|
|
inline |
◆ ~MallocMemoryAllocator()
ogdf::MallocMemoryAllocator::~MallocMemoryAllocator |
( |
| ) |
|
|
inline |
◆ allocate() [1/2]
static void * ogdf::MallocMemoryAllocator::allocate |
( |
size_t |
nBytes | ) |
|
|
inlinestatic |
◆ allocate() [2/2]
static void * ogdf::MallocMemoryAllocator::allocate |
( |
size_t |
nBytes, |
|
|
const char * |
, |
|
|
int |
|
|
) |
| |
|
inlinestatic |
◆ checkSize()
static constexpr bool ogdf::MallocMemoryAllocator::checkSize |
( |
size_t |
| ) |
|
|
inlinestaticconstexpr |
◆ cleanup()
static void ogdf::MallocMemoryAllocator::cleanup |
( |
| ) |
|
|
inlinestatic |
◆ deallocate()
static void ogdf::MallocMemoryAllocator::deallocate |
( |
size_t |
, |
|
|
void * |
p |
|
) |
| |
|
inlinestatic |
Deallocates memory at address p
. We do not keep track of the size of the deallocated object.
Definition at line 72 of file MallocMemoryAllocator.h.
◆ deallocateList()
static void ogdf::MallocMemoryAllocator::deallocateList |
( |
size_t |
, |
|
|
void * |
pHead, |
|
|
void * |
pTail |
|
) |
| |
|
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 78 of file MallocMemoryAllocator.h.
◆ flushPool() [1/2]
static void ogdf::MallocMemoryAllocator::flushPool |
( |
| ) |
|
|
inlinestatic |
◆ flushPool() [2/2]
static void ogdf::MallocMemoryAllocator::flushPool |
( |
uint16_t |
| ) |
|
|
inlinestatic |
◆ memoryAllocatedInBlocks()
static constexpr size_t ogdf::MallocMemoryAllocator::memoryAllocatedInBlocks |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ memoryInFreelist()
static constexpr size_t ogdf::MallocMemoryAllocator::memoryInFreelist |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ memoryInGlobalFreeList()
static constexpr size_t ogdf::MallocMemoryAllocator::memoryInGlobalFreeList |
( |
| ) |
|
|
inlinestaticconstexpr |
◆ memoryInThreadFreeList()
static constexpr size_t ogdf::MallocMemoryAllocator::memoryInThreadFreeList |
( |
| ) |
|
|
inlinestaticconstexpr |
The documentation for this class was generated from the following file: