![]() |
Max OS 0.3
|
Generic memory allocator type. More...
#include <allocator.h>
Public Member Functions | |
| MemoryAllocator () | |
| virtual | ~MemoryAllocator () |
| virtual void | setup_region (uintptr_t address, size_t length) |
| Setup a region to be bump memory managed. | |
| virtual void * | allocate (size_t size) |
| Allocates a block of memory. | |
| virtual void | unallocate (void *pointer) |
| Frees a block of memory. | |
| virtual size_t | amount_used () |
| Returns the amount of memory used (btyes) | |
| virtual size_t | align (size_t size) |
| Aligns the size to the chunk alignment. | |
Generic memory allocator type.
Definition at line 23 of file allocator.h.
|
default |
Default constructor for a generic memory allocator
|
virtualdefault |
Default destructor for a generic memory allocator
|
virtual |
Aligns the size to the chunk alignment.
| size | The size to align |
Reimplemented in MaxOS::memory::allocator::BumpAllocator.
Definition at line 84 of file allocator.cpp.
|
virtual |
Allocates a block of memory.
| size | The size of the block to allocate |
Reimplemented in MaxOS::memory::allocator::BumpAllocator.
Definition at line 57 of file allocator.cpp.
|
virtual |
Returns the amount of memory used (btyes)
Reimplemented in MaxOS::memory::allocator::BumpAllocator.
Definition at line 74 of file allocator.cpp.
|
virtual |
Setup a region to be bump memory managed.
| address | The start of the region |
| length | The length of the region |
Reimplemented in MaxOS::memory::allocator::BumpAllocator.
Definition at line 48 of file allocator.cpp.
|
virtual |
Frees a block of memory.
| pointer | A pointer to the block to free |
Reimplemented in MaxOS::memory::allocator::BumpAllocator.
Definition at line 66 of file allocator.cpp.