Base Framework
|
#include <base/mem/Heap.h>
Inherited by HeapBlockOwned< TYPE >.
Public Member Functions | |
HeapBlock () noexcept | |
HeapBlock (MemorySize size) | |
HeapBlock (const HeapBlock ©) noexcept | |
HeapBlock (HeapBlock &&move) noexcept | |
HeapBlock & | operator= (const HeapBlock &assign) noexcept |
HeapBlock & | operator= (NullPtr assign) noexcept |
HeapBlock & | operator= (TYPE *assign) noexcept |
HeapBlock & | operator= (HeapBlock &&assign) noexcept |
void | resize (MemorySize size) |
bool | tryResize (MemorySize size) noexcept |
MemorySize | getSize () const noexcept |
void | release () |
operator TYPE * () noexcept | |
operator const TYPE * () const noexcept | |
operator bool () const noexcept | |
~HeapBlock () | |
Protected Attributes | |
TYPE * | heap = nullptr |
Pointer to heap. Note destructor will not release heap! Likewise copy construction and assignment copy the pointer value. This is to behave like a normal pointer. You must call release explicitly.
Allocates memory of given size.
|
inlinenoexcept |
Copy of pointer value!
Copy of pointer value!
|
inlinenoexcept |
Returns the size of the block. Can return 0 if not supported.
|
inlinenoexcept |
Returns true if pointer is not nullptr.
|
inlinenoexcept |
Returns the native pointer.
|
inlinenoexcept |
Returns the native pointer.
|
inlinenoexcept |
Assignment of pointer value!
|
inlinenoexcept |
Assignment of pointer value!
Assignment of pointer value!
Assignment of pointer value!
|
inline |
Releases heap. Make sure to call explicitly for normal use cases!
|
inline |
Resizes block.
|
inlinenoexcept |
Tries inplace resize. Returns true on success.