![]() |
Public API Reference |
A separate heap from which memory can be allocated. More...
#include <csutil/memheap.h>
Public Member Functions | |
| void * | Alloc (const size_t n) |
Allocate a block of memory of size n. | |
| size_t | Footprint () |
| Return the total amount of memory used for this heap. | |
| void | Free (void *p) |
Free the block p. | |
| void * | Realloc (void *p, size_t newSize) |
Resize the allocated block p to size newSize. | |
| void | Trim (size_t pad=0) |
| Try to return as much unused memory to the system as possible. | |
A separate heap from which memory can be allocated.
| void* CS::Memory::Heap::Alloc | ( | const size_t | n | ) |
Allocate a block of memory of size n.
| size_t CS::Memory::Heap::Footprint | ( | ) |
Return the total amount of memory used for this heap.
| void CS::Memory::Heap::Free | ( | void * | p | ) |
Free the block p.
| void* CS::Memory::Heap::Realloc | ( | void * | p, |
| size_t | newSize | ||
| ) |
Resize the allocated block p to size newSize.
| void CS::Memory::Heap::Trim | ( | size_t | pad = 0 | ) |
Try to return as much unused memory to the system as possible.
pad optionally specifies a minimum amount of memory to be retained, in case future allocations are anticipated.