FixedSizeMemoryPool is the multi-thread manager of Kratos memory management.
More...
#include <fixed_size_memory_pool.h>
FixedSizeMemoryPool is the multi-thread manager of Kratos memory management.
The memory management of Kratos is implemented based on the design given in Modern C++ Design by A. Alexandrescu. However a new layer is added over the ThreadFixedSizeMemoryPool in order to control the multi-thread creation and destruction of the chunks. This layer keeps ThreadFixedSizeMemoryPool for each thread and is in charge of calling their methods in a thread safe way and also feeds them with new chunk (or reusing the released ones)
◆ SizeType
◆ FixedSizeMemoryPool() [1/3]
Kratos::FixedSizeMemoryPool::FixedSizeMemoryPool |
( |
| ) |
|
|
delete |
Default constructor is deleted.
◆ FixedSizeMemoryPool() [2/3]
Copy constructor is deleted.
◆ FixedSizeMemoryPool() [3/3]
Kratos::FixedSizeMemoryPool::FixedSizeMemoryPool |
( |
std::size_t |
BlockSizeInBytes, |
|
|
SizeType |
ChunkSize = DefaultChunkSize |
|
) |
| |
|
inline |
The constructor to be called.
◆ ~FixedSizeMemoryPool()
virtual Kratos::FixedSizeMemoryPool::~FixedSizeMemoryPool |
( |
| ) |
|
|
inlinevirtual |
◆ Allocate()
void* Kratos::FixedSizeMemoryPool::Allocate |
( |
| ) |
|
|
inline |
This function does not throw and returns zero if cannot allocate.
◆ ChunkSize()
SizeType Kratos::FixedSizeMemoryPool::ChunkSize |
( |
| ) |
const |
|
inline |
◆ Deallocate()
void Kratos::FixedSizeMemoryPool::Deallocate |
( |
void * |
pPointrerToRelease | ) |
|
|
inline |
◆ GetNumberOfAllocatedChunks()
std::size_t Kratos::FixedSizeMemoryPool::GetNumberOfAllocatedChunks |
( |
| ) |
const |
|
inline |
◆ Info()
std::string Kratos::FixedSizeMemoryPool::Info |
( |
| ) |
const |
|
inline |
Turn back information as a string.
◆ MemoryOverhead()
std::size_t Kratos::FixedSizeMemoryPool::MemoryOverhead |
( |
| ) |
const |
|
inline |
◆ MemoryUsed()
std::size_t Kratos::FixedSizeMemoryPool::MemoryUsed |
( |
| ) |
const |
|
inline |
◆ operator=()
Assignment operator is deleted.
◆ PrintData()
void Kratos::FixedSizeMemoryPool::PrintData |
( |
std::ostream & |
rOStream | ) |
const |
|
inline |
◆ PrintInfo()
void Kratos::FixedSizeMemoryPool::PrintInfo |
( |
std::ostream & |
rOStream | ) |
const |
|
inline |
Print information about this object.
◆ DefaultChunkSize
constexpr SizeType Kratos::FixedSizeMemoryPool::DefaultChunkSize = 1024*1024 |
|
staticconstexpr |
The documentation for this class was generated from the following file: