Allocator is a bump-pointer allocator with an SPI for getting more memory from embedder-implemented allocator, such as malloc()/free().
More...
#include <Allocator.h>
List of all members.
Detailed Description
Allocator is a bump-pointer allocator with an SPI for getting more memory from embedder-implemented allocator, such as malloc()/free().
alloc() never returns NULL. The implementation of allocChunk() is expected to perform a longjmp or exception when an allocation can't proceed. fallibleAlloc() (and fallibleAllocChunk()) may return NULL. They should be used for large allocations whose failure can be handled without too much difficulty.
Constructor & Destructor Documentation
| nanojit::Allocator::Allocator |
( |
|
) |
|
| nanojit::Allocator::~Allocator |
( |
|
) |
|
Member Function Documentation
| void* nanojit::Allocator::alloc |
( |
size_t |
nbytes |
) |
[inline] |
alloc memory, never return null.
| void* nanojit::Allocator::allocChunk |
( |
size_t |
nbytes, |
|
|
bool |
fallible | |
|
) |
| | [protected] |
allocate another block from a host provided allocator
| void* nanojit::Allocator::allocSlow |
( |
size_t |
nbytes, |
|
|
bool |
fallible = false | |
|
) |
| | [protected] |
| void* nanojit::Allocator::fallibleAlloc |
( |
size_t |
nbytes |
) |
[inline] |
alloc memory, maybe return null.
| bool nanojit::Allocator::fill |
( |
size_t |
minbytes, |
|
|
bool |
fallible | |
|
) |
| | [protected] |
| void nanojit::Allocator::freeChunk |
( |
void * |
|
) |
[protected] |
free back to the same allocator
| void nanojit::Allocator::postReset |
( |
|
) |
[protected] |
hook for post-reset action.
| void nanojit::Allocator::reset |
( |
|
) |
|
Member Data Documentation
The documentation for this class was generated from the following file: