A basic memory allocator.
Name | Description |
---|---|
std::size_t size_type | The type used to represent memory sizes. |
Name | Description |
---|---|
Allocate(size_type, size_type) | Find the first fit free block and do the allocation. |
BasicAllocator(void *, size_type) | Creates a BasicAllocator that allocates memory within the given block. |
Free(void *) | Free an existing allocation. |
IsAllocationValid(void *) | Checks if a block of memory is a valid allocation. |
public: void * Allocate
(
size_type size,
size_type alignment
)
Find the first fit free block and do the allocation.
public: BasicAllocator
(
void * memory,
size_type size
)
Creates a BasicAllocator that allocates memory within the given block.
public: void Free
(
void * mem
)
Free an existing allocation.
public: bool IsAllocationValid
(
void * mem
)
Checks if a block of memory is a valid allocation.