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

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

List of all members.

Public Member Functions

 PooledAllocator (int blocksize=BLOCKSIZE)
 Default constructor.
 ~PooledAllocator ()
 Destructor.
void * malloc (int 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 (size_t count=1)
 Allocates (using this pool) a generic type T.

Public Attributes

int usedMemory
int wastedMemory

Private Attributes

int remaining
void * base
void * loc
int blocksize

Constructor & Destructor Documentation

nanoflann::PooledAllocator::PooledAllocator ( int  blocksize = BLOCKSIZE) [inline]

Default constructor.

Initializes a new pool.

Definition at line 451 of file nanoflann.hpp.

nanoflann::PooledAllocator::~PooledAllocator ( ) [inline]

Destructor.

Frees all the memory allocated in this pool.

Definition at line 464 of file nanoflann.hpp.


Member Function Documentation

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

void* nanoflann::PooledAllocator::malloc ( int  size) [inline]

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

Definition at line 479 of file nanoflann.hpp.

References nanoflann::WORDSIZE, nanoflann::BLOCKSIZE, mrpt::system::os::fprintf(), and nanoflann::KNNResultSet::size().


Member Data Documentation

Definition at line 439 of file nanoflann.hpp.

Definition at line 441 of file nanoflann.hpp.

Definition at line 440 of file nanoflann.hpp.

Definition at line 438 of file nanoflann.hpp.

Definition at line 445 of file nanoflann.hpp.

Definition at line 446 of file nanoflann.hpp.




Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011