Heap implementation.
More...
#include <base/mem/Heap.h>
Inherited by Heap [private]
.
Heap implementation.
This class encapsulates the implementation used by the Heap class. Do not use this class directly.
- See also
- Heap
- Version
- 1.0
◆ allocate()
static void* HeapImpl::allocate |
( |
MemorySize |
size | ) |
|
|
staticprotected |
Allocates the specified number of bytes on the heap. Raises MemoryException if unable to allocate the memory block. Returns nullptr for size 0.
- Parameters
-
size | The desired size of the memory block in number of bytes. |
◆ allocateNoThrow()
static void* HeapImpl::allocateNoThrow |
( |
MemorySize |
size | ) |
|
|
staticprotectednoexcept |
Allocates the specified number of bytes on the heap. Returns nullptr if unable to allocate the memory block. Returns nullptr for size 0.
- Parameters
-
size | The desired size of the memory block in number of bytes. |
◆ getHeapUsed()
static MemorySize HeapImpl::getHeapUsed |
( |
| ) |
|
|
staticprotectednoexcept |
Returns the total heap used.
◆ getMinimumSize()
static MemorySize HeapImpl::getMinimumSize |
( |
| ) |
|
|
staticprotectednoexcept |
Returns the minimum block size.
◆ getSize()
static MemorySize HeapImpl::getSize |
( |
void * |
heap | ) |
|
|
staticprotectednoexcept |
Returns the size of the memory block.
◆ release()
static void HeapImpl::release |
( |
void * |
heap | ) |
|
|
staticprotected |
Frees the specified memory block previously allocated by 'allocate' or 'reallocate'. Raises MemoryException if unable to free the memory.
- Parameters
-
◆ resize()
static void* HeapImpl::resize |
( |
void * |
heap, |
|
|
MemorySize |
size |
|
) |
| |
|
staticprotected |
Resizes the specified memory block. Raises MemoryException if unable allocate memory block. Memory block may be moved when memory is made smaller. Returns nullptr for size 0.
- Parameters
-
heap | The memory block. |
size | The desired size of the memory block in number of bytes. |
◆ tryResize()
static void* HeapImpl::tryResize |
( |
void * |
heap, |
|
|
MemorySize |
size |
|
) |
| |
|
staticprotected |
Tries to resize the specified memory block without movement. Raises MemoryException on allocation failure.
- Parameters
-
heap | The memory block. |
size | The desired size of the memory block in number of bytes. |
- Returns
- nullptr if unable to resize memory block or size was 0.