OpenLB 1.7
|
#include <nanoflann.hpp>
Public Member Functions | |
PooledAllocator (const size_t blocksize_=BLOCKSIZE) | |
Default constructor. | |
~PooledAllocator () | |
Destructor. | |
void | free_all () |
Frees all allocated memory chunks. | |
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 |
Definition at line 532 of file nanoflann.hpp.
|
inline |
Default constructor.
Initializes a new pool.
Definition at line 557 of file nanoflann.hpp.
|
inline |
Destructor.
Frees all the memory allocated in this pool.
Definition at line 565 of file nanoflann.hpp.
|
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 636 of file nanoflann.hpp.
|
inline |
Frees all allocated memory chunks.
Definition at line 570 of file nanoflann.hpp.
|
inline |
Returns a pointer to a piece of new memory of the given size in bytes allocated from the pool.
Definition at line 583 of file nanoflann.hpp.
References nanoflann::BLOCKSIZE, and nanoflann::WORDSIZE.
size_t nanoflann::PooledAllocator::usedMemory |
Definition at line 551 of file nanoflann.hpp.
size_t nanoflann::PooledAllocator::wastedMemory |
Definition at line 552 of file nanoflann.hpp.