#include <allocator.h>
Public Member Functions | |
PooledAllocator (int blockSize=BLOCKSIZE) | |
~PooledAllocator () | |
void * | allocateMemory (int size) |
template<typename T > | |
T * | allocate (size_t count=1) |
Public Attributes | |
int | usedMemory |
int | wastedMemory |
Default constructor. Initializes a new pool.
cvflann::PooledAllocator::~PooledAllocator | ( | ) |
Destructor. Frees all the memory allocated in this pool.
Returns a pointer to a piece of new memory of the given size in bytes allocated from the pool.
T* cvflann::PooledAllocator::allocate | ( | size_t | count = 1 | ) |
Allocates (using this pool) a generic type T.
Params: count = number of instances to allocate. Returns: pointer (of type T*) to memory buffer
int cvflann::PooledAllocator::usedMemory |
int cvflann::PooledAllocator::wastedMemory |