![]() |
ACloudViewer
3.9.4
A Modern Library for 3D Data Processing
|
#include <allocator.h>
Public Member Functions | |
| PooledAllocator (int blocksize=BLOCKSIZE) | |
| ~PooledAllocator () | |
| void | free () |
| void * | allocateMemory (int size) |
| template<typename T > | |
| T * | allocate (size_t count=1) |
Public Attributes | |
| int | usedMemory |
| int | wastedMemory |
Definition at line 75 of file allocator.h.
|
inline |
Default constructor. Initializes a new pool.
Definition at line 96 of file allocator.h.
References NULL, usedMemory, and wastedMemory.
|
inline |
Destructor. Frees all the memory allocated in this pool.
Definition at line 109 of file allocator.h.
References free().
|
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 187 of file allocator.h.
References allocateMemory(), and count.
|
inline |
Returns a pointer to a piece of new memory of the given size in bytes allocated from the pool.
Definition at line 132 of file allocator.h.
References flann::BLOCKSIZE, NULL, size, usedMemory, wastedMemory, and flann::WORDSIZE.
Referenced by allocate().
|
inline |
Definition at line 114 of file allocator.h.
References NULL, usedMemory, and wastedMemory.
Referenced by flann::KDTreeIndex< Distance >::freeIndex(), and ~PooledAllocator().
| int flann::PooledAllocator::usedMemory |
Definition at line 90 of file allocator.h.
Referenced by allocateMemory(), free(), PooledAllocator(), flann::HierarchicalClusteringIndex< Distance >::usedMemory(), flann::KDTreeIndex< Distance >::usedMemory(), flann::KDTreeSingleIndex< Distance >::usedMemory(), and flann::KMeansIndex< Distance >::usedMemory().
| int flann::PooledAllocator::wastedMemory |
Definition at line 91 of file allocator.h.
Referenced by allocateMemory(), free(), PooledAllocator(), flann::HierarchicalClusteringIndex< Distance >::usedMemory(), flann::KDTreeIndex< Distance >::usedMemory(), flann::KDTreeSingleIndex< Distance >::usedMemory(), and flann::KMeansIndex< Distance >::usedMemory().