![]() |
Elm
2
ELM is a library providing generic data structures, OS-independent interface, plugins and XML.
|
#include <elm/alloc/DefaultAllocator.h>
Public Member Functions | |
void * | allocate (t::size size) |
virtual bool | mark (void *data, t::size size) |
void | free (void *block) |
virtual | ~DefaultAllocator () |
Static Public Attributes | |
static DefaultAllocator | DEFAULT |
Default implementation of a memory allocator just calling new and delete.
|
inlinevirtual |
Allocate a memory block of the given size.
size | Size of the block to allocate. |
BadAlloc | Thrown if there is no more system memory. |
Referenced by DefaultAllocatorDelegate::allocate().
Free the given block.
block | Block to free. |
Referenced by DefaultAllocatorDelegate::free().
Mark a memory block of the given size so that it will not be released by the garbage collector.
data | The data to collect |
size | Size of the block to allocate. |
Reimplemented in GroupedGC.
|
static |
Default allocator.
Referenced by DefaultAllocatorDelegate::allocate(), and DefaultAllocatorDelegate::free().