#include <concrete/allocation.hpp>
List of all members.
Detailed Description
Arena memory allocator implementation.
Member Enumeration Documentation
- Enumerator:
Alignment |
Alignment for allocation start addresses in bytes.
|
- Enumerator:
InitialAddress |
Guaranteed Arena offset of the first allocation.
|
Constructor & Destructor Documentation
Allocator |
( |
size_t |
size_limit | ) |
throw () [explicit] |
Start with an empty arena.
- Parameters:
-
size_limit | defines the maximum size of the arena |
Allocator |
( |
void * |
data, |
|
|
size_t |
size, |
|
|
size_t |
size_limit |
|
) |
| throw () |
Start with a populated arena. If the provided data is invalid, future free() calls may fail.
- Parameters:
-
data | of the arena; will be stolen |
size | of the arena in bytes |
size_limit | defines the maximum size of the arena |
Member Function Documentation
static uint32_t AlignedSize |
( |
size_t |
size | ) |
throw () [static] |
- Returns:
- size aligned according to Alignment
Allocate a block of memory.
- Parameters:
-
bool free |
( |
unsigned int |
address, |
|
|
void * |
data, |
|
|
size_t |
size |
|
) |
| throw () |
Free a block of memory.
- Parameters:
-
address | of the memory block within the arena |
data | pointer to the memory block |
size | of the memory block |
- Returns:
- false if the arena is corrupted