Classes | Public Member Functions | Protected Member Functions | Protected Attributes

nanojit::Allocator Class Reference

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>

Collaboration diagram for nanojit::Allocator:

List of all members.

Classes

class  Chunk

Public Member Functions

 Allocator ()
 ~Allocator ()
void reset ()
void * alloc (size_t nbytes)
 alloc memory, never return null.

Protected Member Functions

void * allocSlow (size_t nbytes)
void fill (size_t minbytes)
void * allocChunk (size_t nbytes)
 allocate another block from a host provided allocator
void freeChunk (void *)
 free back to the same allocator
void postReset ()
 hook for post-reset action.

Protected Attributes

Chunkcurrent_chunk
char * current_top
char * current_limit

Detailed Description

Allocator is a bump-pointer allocator with an SPI for getting more memory from embedder-implemented allocator, such as malloc()/free().

allocations never return NULL. The implementation of allocChunk() is expected to perform a longjmp or exception when an allocation can't proceed.


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  )  [protected]

allocate another block from a host provided allocator

void* nanojit::Allocator::allocSlow ( size_t  nbytes  )  [protected]
void nanojit::Allocator::fill ( size_t  minbytes  )  [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: