ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
flann::PooledAllocator Class Reference

#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
 

Detailed Description

Definition at line 75 of file allocator.h.

Constructor & Destructor Documentation

◆ PooledAllocator()

flann::PooledAllocator::PooledAllocator ( int  blocksize = BLOCKSIZE)
inline

Default constructor. Initializes a new pool.

Definition at line 96 of file allocator.h.

References NULL, usedMemory, and wastedMemory.

◆ ~PooledAllocator()

flann::PooledAllocator::~PooledAllocator ( )
inline

Destructor. Frees all the memory allocated in this pool.

Definition at line 109 of file allocator.h.

References free().

Member Function Documentation

◆ allocate()

template<typename T >
T* flann::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 187 of file allocator.h.

References allocateMemory(), and count.

◆ allocateMemory()

void* flann::PooledAllocator::allocateMemory ( 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 132 of file allocator.h.

References flann::BLOCKSIZE, NULL, size, usedMemory, wastedMemory, and flann::WORDSIZE.

Referenced by allocate().

◆ free()

void flann::PooledAllocator::free ( )
inline

Definition at line 114 of file allocator.h.

References NULL, usedMemory, and wastedMemory.

Referenced by flann::KDTreeIndex< Distance >::freeIndex(), and ~PooledAllocator().

Member Data Documentation

◆ usedMemory

◆ wastedMemory


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