nanoflann
C++ header-only ANN library
 All Classes Functions Variables Typedefs Groups Pages
Public Member Functions | Public Attributes | List of all members
nanoflann::PooledAllocator Class Reference

Public Member Functions

 PooledAllocator ()
 
 ~PooledAllocator ()
 
void free_all ()
 
void * malloc (const size_t req_size)
 
template<typename T >
T * allocate (const size_t count=1)
 

Public Attributes

size_t usedMemory
 
size_t wastedMemory
 

Constructor & Destructor Documentation

nanoflann::PooledAllocator::PooledAllocator ( )
inline

Default constructor. Initializes a new pool.

nanoflann::PooledAllocator::~PooledAllocator ( )
inline

Destructor. Frees all the memory allocated in this pool.

Member Function Documentation

template<typename T >
T* nanoflann::PooledAllocator::allocate ( const 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

void nanoflann::PooledAllocator::free_all ( )
inline

Frees all allocated memory chunks

void* nanoflann::PooledAllocator::malloc ( const size_t  req_size)
inline

Returns a pointer to a piece of new memory of the given size in bytes allocated from the pool.


The documentation for this class was generated from the following file: