Heap memory manager class.
More...
#include <allocator_heap.h>
Heap memory manager class.
Heap memory manager will allocate memory in system heap. Windows: HeapAlloc()/HeapFree() Unix: malloc()/free()
Not thread-safe.
Definition at line 34 of file allocator_heap.h.
◆ HeapMemoryManager() [1/3]
CppCommon::HeapMemoryManager::HeapMemoryManager |
( |
| ) |
|
|
inlinenoexcept |
◆ HeapMemoryManager() [2/3]
◆ HeapMemoryManager() [3/3]
◆ ~HeapMemoryManager()
CppCommon::HeapMemoryManager::~HeapMemoryManager |
( |
| ) |
|
|
inlinenoexcept |
◆ allocated()
size_t CppCommon::HeapMemoryManager::allocated |
( |
| ) |
const |
|
inlinenoexcept |
◆ allocations()
size_t CppCommon::HeapMemoryManager::allocations |
( |
| ) |
const |
|
inlinenoexcept |
◆ free()
void CppCommon::HeapMemoryManager::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 30 of file allocator_heap.inl.
◆ malloc()
void * CppCommon::HeapMemoryManager::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_heap.inl.
◆ max_size()
size_t CppCommon::HeapMemoryManager::max_size |
( |
| ) |
const |
|
inlinenoexcept |
Maximum memory block size, that could be allocated by the memory manager.
Definition at line 51 of file allocator_heap.h.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ reset()
void CppCommon::HeapMemoryManager::reset |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following files: