#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 |
| cvflann::PooledAllocator::PooledAllocator | ( | int | blockSize = BLOCKSIZE | ) |
Default constructor. Initializes a new pool.
Destructor. Frees all the memory allocated in this pool.
| void* cvflann::PooledAllocator::allocateMemory | ( | int | size | ) |
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