Main MRPT website > C++ reference
MRPT logo
List of all members | Public Member Functions | Public Attributes | Private Attributes
nanoflann::PooledAllocator Class Reference

Detailed Description

Definition at line 434 of file nanoflann.hpp.

#include <mrpt/otherlibs/nanoflann/nanoflann.hpp>

Public Member Functions

 PooledAllocator (const size_t blocksize=BLOCKSIZE)
 Default constructor.
 
 ~PooledAllocator ()
 Destructor.
 
void * malloc (const size_t req_size)
 Returns a pointer to a piece of new memory of the given size in bytes allocated from the pool.
 
template<typename T >
T * allocate (const size_t count=1)
 Allocates (using this pool) a generic type T.
 

Public Attributes

size_t usedMemory
 
size_t wastedMemory
 

Private Attributes

size_t remaining
 
void * base
 
void * loc
 
size_t blocksize
 

Constructor & Destructor Documentation

nanoflann::PooledAllocator::PooledAllocator ( const size_t  blocksize = BLOCKSIZE)
inline

Default constructor.

Initializes a new pool.

Definition at line 455 of file nanoflann.hpp.

nanoflann::PooledAllocator::~PooledAllocator ( )
inline

Destructor.

Frees all the memory allocated in this pool.

Definition at line 468 of file nanoflann.hpp.

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

Definition at line 534 of file nanoflann.hpp.

References nanoflann::KNNResultSet< DistanceType, IndexType, CountType >::count.

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.

Definition at line 481 of file nanoflann.hpp.

References nanoflann::BLOCKSIZE, mrpt::system::os::fprintf(), nanoflann::KNNResultSet< DistanceType, IndexType, CountType >::size(), and nanoflann::WORDSIZE.

Member Data Documentation

void* nanoflann::PooledAllocator::base
private

Definition at line 443 of file nanoflann.hpp.

size_t nanoflann::PooledAllocator::blocksize
private

Definition at line 445 of file nanoflann.hpp.

void* nanoflann::PooledAllocator::loc
private

Definition at line 444 of file nanoflann.hpp.

size_t nanoflann::PooledAllocator::remaining
private

Definition at line 442 of file nanoflann.hpp.

size_t nanoflann::PooledAllocator::usedMemory

Definition at line 449 of file nanoflann.hpp.

size_t nanoflann::PooledAllocator::wastedMemory

Definition at line 450 of file nanoflann.hpp.




Page generated by Doxygen 1.8.3 for MRPT 0.9.6 SVN: at Fri Feb 15 22:05:02 EST 2013