|
EasyNav Plugins
|
The GridBlockAllocator is used to pre-allocate the meory of multiple Grids in "chunks". More...
#include <grid_allocator.hpp>

Classes | |
| struct | Chunk |
Public Types | |
| using | Deleter = std::function<void()> |
Public Member Functions | |
| std::pair< DataT *, Deleter > | allocateBlock () |
| size_t | capacity () const |
| void | clear () |
| GridBlockAllocator (const GridBlockAllocator &)=delete | |
| GridBlockAllocator (GridBlockAllocator &&)=default | |
| GridBlockAllocator (size_t log2dim) | |
| size_t | memUsage () const |
| GridBlockAllocator & | operator= (const GridBlockAllocator &other)=delete |
| GridBlockAllocator & | operator= (GridBlockAllocator &&other)=default |
| void | releaseUnusedMemory () |
| size_t | size () const |
Static Public Attributes | |
| static constexpr size_t | blocks_per_chunk = 512 |
Protected Member Functions | |
| void | addNewChunk () |
| Deleter | createDeleter (std::shared_ptr< Chunk > chunk, uint32_t index) |
Protected Attributes | |
| size_t | block_bytes_ = 0 |
| size_t | capacity_ = 0 |
| std::vector< std::shared_ptr< Chunk > > | chunks_ |
| size_t | log2dim_ = 0 |
| std::unique_ptr< std::mutex > | mutex_ |
| size_t | size_ = 0 |
The GridBlockAllocator is used to pre-allocate the meory of multiple Grids in "chunks".
It is a very simple memory pool.
Each chunk allocates memory for 512 Grids
| using Deleter = std::function<void()> |
| GridBlockAllocator | ( | size_t | log2dim | ) |
|
delete |
|
default |
|
protected |
| std::pair< DataT *, typename GridBlockAllocator< DataT >::Deleter > allocateBlock | ( | ) |
| size_t capacity | ( | ) | const |
| void clear | ( | ) |
|
protected |
| size_t memUsage | ( | ) | const |
|
delete |
|
default |
| void releaseUnusedMemory | ( | ) |
| size_t size | ( | ) | const |
|
protected |
|
staticconstexpr |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |