#include <allocator.h>
Public Member Functions | |
template<typename T > | |
T * | allocate (size_t count=1) |
void * | allocateBytes (int size) |
PooledAllocator (int blocksize=BLOCKSIZE) | |
~PooledAllocator () | |
Public Attributes | |
int | usedMemory |
int | wastedMemory |
Private Attributes | |
void * | base |
int | blocksize |
void * | loc |
int | remaining |
Definition at line 73 of file allocator.h.
cvflann::PooledAllocator::PooledAllocator | ( | int | blocksize = BLOCKSIZE |
) | [inline] |
Default constructor. Initializes a new pool.
Definition at line 94 of file allocator.h.
cvflann::PooledAllocator::~PooledAllocator | ( | ) | [inline] |
Destructor. Frees all the memory allocated in this pool.
Definition at line 107 of file allocator.h.
T* cvflann::PooledAllocator::allocate | ( | size_t | count = 1 |
) | [inline] |
Allocates (using this pool) a generic type T.
Params: count = number of instances to allocate. Returns: pointer (of type T*) to memory buffer
Definition at line 177 of file allocator.h.
void* cvflann::PooledAllocator::allocateBytes | ( | int | size | ) | [inline] |
Returns a pointer to a piece of new memory of the given size in bytes allocated from the pool.
Definition at line 122 of file allocator.h.
void* cvflann::PooledAllocator::base [private] |
Definition at line 82 of file allocator.h.
int cvflann::PooledAllocator::blocksize [private] |
Definition at line 84 of file allocator.h.
void* cvflann::PooledAllocator::loc [private] |
Definition at line 83 of file allocator.h.
int cvflann::PooledAllocator::remaining [private] |
Definition at line 81 of file allocator.h.
Definition at line 88 of file allocator.h.
Definition at line 89 of file allocator.h.