ThreadFixedSizeMemoryPool holds chunks belong to a certain thread and operate over them.
More...
#include <thread_fixed_size_memory_pool.h>
ThreadFixedSizeMemoryPool holds chunks belong to a certain thread and operate over them.
The memory management of Kratos is implemented based on the design given in Modern C++ Design by A. Alexandrescu and ThreadFixedSizeMemoryPool is the second layer of it "Called FixedAllocator" holding chunks. This class is the owner of the chunks of this thread and the only one who can allocate in them. The rest of the threads would only deallocate objects.
◆ ChunkList
◆ SizeType
◆ ThreadFixedSizeMemoryPool() [1/4]
Kratos::ThreadFixedSizeMemoryPool::ThreadFixedSizeMemoryPool |
( |
| ) |
|
|
delete |
Default constructor is deleted.
◆ ThreadFixedSizeMemoryPool() [2/4]
Copy constructor is deleted.
◆ ThreadFixedSizeMemoryPool() [3/4]
Move constructor to be used in STL containers.
◆ ThreadFixedSizeMemoryPool() [4/4]
Kratos::ThreadFixedSizeMemoryPool::ThreadFixedSizeMemoryPool |
( |
std::size_t |
BlockSizeInBytes, |
|
|
SizeType |
ChunkSize, |
|
|
std::size_t |
ThreadNumber |
|
) |
| |
|
inline |
The constructor to be called.
◆ ~ThreadFixedSizeMemoryPool()
virtual Kratos::ThreadFixedSizeMemoryPool::~ThreadFixedSizeMemoryPool |
( |
| ) |
|
|
inlinevirtual |
◆ Allocate()
void* Kratos::ThreadFixedSizeMemoryPool::Allocate |
( |
| ) |
|
|
inline |
This function does not throw and returns zero if cannot allocate.
◆ ChunkSize()
SizeType Kratos::ThreadFixedSizeMemoryPool::ChunkSize |
( |
| ) |
const |
|
inline |
◆ Deallocate()
bool Kratos::ThreadFixedSizeMemoryPool::Deallocate |
( |
void * |
pPointerToRelease | ) |
|
|
inline |
◆ GetNumberOfAvailableChunks()
std::size_t Kratos::ThreadFixedSizeMemoryPool::GetNumberOfAvailableChunks |
( |
| ) |
const |
|
inline |
◆ GetNumberOfChunks()
std::size_t Kratos::ThreadFixedSizeMemoryPool::GetNumberOfChunks |
( |
| ) |
const |
|
inline |
◆ GetNumberOfReleasedChunks()
std::size_t Kratos::ThreadFixedSizeMemoryPool::GetNumberOfReleasedChunks |
( |
| ) |
const |
|
inline |
◆ HasAvailableChunk()
bool Kratos::ThreadFixedSizeMemoryPool::HasAvailableChunk |
( |
| ) |
|
|
inline |
◆ Info()
std::string Kratos::ThreadFixedSizeMemoryPool::Info |
( |
| ) |
const |
|
inline |
Turn back information as a string.
◆ lock()
void Kratos::ThreadFixedSizeMemoryPool::lock |
( |
| ) |
|
|
inline |
◆ MemoryOverhead()
std::size_t Kratos::ThreadFixedSizeMemoryPool::MemoryOverhead |
( |
| ) |
const |
|
inline |
◆ MemoryUsed()
std::size_t Kratos::ThreadFixedSizeMemoryPool::MemoryUsed |
( |
| ) |
const |
|
inline |
◆ operator=()
Assignment operator is deleted.
◆ PrintData()
void Kratos::ThreadFixedSizeMemoryPool::PrintData |
( |
std::ostream & |
rOStream | ) |
const |
|
inline |
◆ PrintInfo()
void Kratos::ThreadFixedSizeMemoryPool::PrintInfo |
( |
std::ostream & |
rOStream | ) |
const |
|
inline |
Print information about this object.
◆ Release()
void Kratos::ThreadFixedSizeMemoryPool::Release |
( |
| ) |
|
|
inline |
◆ unlock()
void Kratos::ThreadFixedSizeMemoryPool::unlock |
( |
| ) |
|
|
inline |
◆ MaximumEmptyChunksToKeep
constexpr SizeType Kratos::ThreadFixedSizeMemoryPool::MaximumEmptyChunksToKeep = 4 |
|
staticconstexpr |
◆ MaximumPointersToKeep
constexpr SizeType Kratos::ThreadFixedSizeMemoryPool::MaximumPointersToKeep = 1024 |
|
staticconstexpr |
The documentation for this class was generated from the following file: