CppCommon
1.0.4.1
C++ Common Library
|
Null memory manager class. More...
#include <allocator_null.h>
Public Member Functions | |
NullMemoryManager () noexcept | |
NullMemoryManager (const NullMemoryManager &)=delete | |
NullMemoryManager (NullMemoryManager &&)=delete | |
~NullMemoryManager () noexcept | |
NullMemoryManager & | operator= (const NullMemoryManager &)=delete |
NullMemoryManager & | operator= (NullMemoryManager &&)=delete |
size_t | allocated () const noexcept |
Allocated memory in bytes. More... | |
size_t | allocations () const noexcept |
Count of active memory allocations. More... | |
size_t | max_size () const noexcept |
Maximum memory block size, that could be allocated by the memory manager. More... | |
void * | malloc (size_t size, size_t alignment=alignof(std::max_align_t)) |
Allocate a new memory block of the given size. More... | |
void | free (void *ptr, size_t size) |
Free the previously allocated memory block. More... | |
void | reset () |
Reset the memory manager. More... | |
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.
|
inlinenoexcept |
Definition at line 26 of file allocator_null.h.
|
delete |
|
delete |
|
inlinenoexcept |
Definition at line 29 of file allocator_null.h.
|
inlinenoexcept |
Allocated memory in bytes.
Definition at line 35 of file allocator_null.h.
|
inlinenoexcept |
Count of active memory allocations.
Definition at line 37 of file allocator_null.h.
|
inline |
Free the previously allocated memory block.
ptr | - Pointer to the memory block |
size | - Block size |
Definition at line 20 of file allocator_null.inl.
|
inline |
Allocate a new memory block of the given size.
size | - Block size |
alignment | - Block alignment (default is alignof(std::max_align_t)) |
Definition at line 11 of file allocator_null.inl.
|
inlinenoexcept |
Maximum memory block size, that could be allocated by the memory manager.
Definition at line 40 of file allocator_null.h.
|
delete |
|
delete |
|
inline |
Reset the memory manager.
Definition at line 32 of file allocator_null.inl.