Null memory manager class.
More...
#include <allocator_null.h>
Null memory manager class.
Null memory manager will always return nullptr for any attempt to allocate a memory buffer of the given size.
Not thread-safe.
Definition at line 23 of file allocator_null.h.
◆ NullMemoryManager() [1/3]
| CppCommon::NullMemoryManager::NullMemoryManager |
( |
| ) |
|
|
inlinenoexcept |
◆ NullMemoryManager() [2/3]
| CppCommon::NullMemoryManager::NullMemoryManager |
( |
const NullMemoryManager & | | ) |
|
|
delete |
◆ NullMemoryManager() [3/3]
| CppCommon::NullMemoryManager::NullMemoryManager |
( |
NullMemoryManager && | | ) |
|
|
delete |
◆ ~NullMemoryManager()
| CppCommon::NullMemoryManager::~NullMemoryManager |
( |
| ) |
|
|
inlinenoexcept |
◆ allocated()
| size_t CppCommon::NullMemoryManager::allocated |
( |
| ) |
const |
|
inlinenoexcept |
◆ allocations()
| size_t CppCommon::NullMemoryManager::allocations |
( |
| ) |
const |
|
inlinenoexcept |
◆ free()
| void CppCommon::NullMemoryManager::free |
( |
void * | ptr, |
|
|
size_t | size ) |
|
inline |
Free the previously allocated memory block.
- Parameters
-
| ptr | - Pointer to the memory block |
| size | - Block size |
Definition at line 20 of file allocator_null.inl.
◆ malloc()
| void * CppCommon::NullMemoryManager::malloc |
( |
size_t | size, |
|
|
size_t | alignment = alignof(std::max_align_t) ) |
|
inline |
Allocate a new memory block of the given size.
- Parameters
-
| size | - Block size |
| alignment | - Block alignment (default is alignof(std::max_align_t)) |
- Returns
- A pointer to the allocated memory block or nullptr in case of allocation failed
Definition at line 11 of file allocator_null.inl.
◆ max_size()
| size_t CppCommon::NullMemoryManager::max_size |
( |
| ) |
const |
|
inlinenoexcept |
Maximum memory block size, that could be allocated by the memory manager.
Definition at line 40 of file allocator_null.h.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ reset()
| void CppCommon::NullMemoryManager::reset |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following files: