KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
Chunk is the smallest building block of Kratos memory management. More...
#include <chunk.h>
Public Types | |
Type Definitions | |
using | BlockType = std::int64_t |
using | SizeType = std::size_t |
Public Member Functions | |
Life Cycle | |
Chunk ()=delete | |
Default constructor is deleted. More... | |
Chunk (Chunk const &rOther)=delete | |
Copy constructor is deleted. More... | |
Chunk (Chunk &&rOther)=delete | |
Chunk (std::size_t BlockSizeInBytes, SizeType SizeInBytes) noexcept | |
The constructor to be called. More... | |
~Chunk () noexcept | |
Destructor is not virtual. This class can not be drived. More... | |
Operators | |
Chunk & | operator= (Chunk const &rOther)=delete |
Assignment operator is deleted. More... | |
Access | |
SizeType | GetNumberOfBlocks () const |
SizeType | GetNumberOfAvailableBlocks () const |
const BlockType * | pGetData () const |
const BlockType * | pDataBegin () const |
const BlockType * | pDataEnd () const |
Inquiry | |
bool | HasAvailableBlock () const |
bool | Has (const void *pThePointer) const |
bool | IsEmpty () const |
bool | IsFull () |
bool | IsInitialized () const |
bool | IsReleased () const |
void | lock () |
void | unlock () |
Input and output | |
std::string | Info () const |
Turn back information as a string. More... | |
void | PrintInfo (std::ostream &rOStream) const |
Print information about this object. More... | |
void | PrintData (std::ostream &rOStream) const |
Print object's data. More... | |
Operations | |
void | Initialize () |
void * | Allocate () |
This function does not throw and returns zero if cannot allocate. More... | |
void | Deallocate (void *pPointrerToRelease) |
void | Release () |
std::size_t | Size () const |
std::size_t | MemoryUsed () const |
std::size_t | MemoryOverhead () const |
Chunk is the smallest building block of Kratos memory management.
The memory management of Kratos is implemented based on the design given in Modern C++ Design by A. Alexandrescu and chunk is the lower layer of it holding a chunk of NumberOfBlocks objects of BlockSize. This implementation is designed for large chunk size (i.e. 1M) imposes more overhead than the reference for storing a header containing the chunk size and block size.
using Kratos::Chunk::BlockType = std::int64_t |
using Kratos::Chunk::SizeType = std::size_t |
|
delete |
Default constructor is deleted.
|
delete |
Copy constructor is deleted.
|
delete |
|
inlinenoexcept |
The constructor to be called.
|
inlinenoexcept |
Destructor is not virtual. This class can not be drived.
|
inline |
This function does not throw and returns zero if cannot allocate.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Turn back information as a string.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Print object's data.
|
inline |
Print information about this object.
|
inline |
|
inline |
|
inline |