An interface which can allocate memory.
More...
#include <Heap.hpp>
|
virtual void * | Alloc (const int ASize)=0 |
| Allocate memory from the heap for use. More...
|
|
virtual void * | Realloc (void *const APreviousAllocation, const int ANewSize)=0 |
| Allocate memory from the heap for use while preserving previous data. Passing a valid APreviousAllocation with ANewSize of zero is equivalent to calling Free(APreviousAllocation ) More...
|
|
virtual void | Free (void *const APreviousAllocation) noexcept=0 |
| Return memory to the heap. Data in allocated range will be lost. More...
|
|
An interface which can allocate memory.
Definition at line 5 of file Heap.hpp.
virtual void* CYB::API::Heap::Alloc |
( |
const int |
ASize | ) |
|
|
pure virtual |
Allocate memory from the heap for use.
- Parameters
-
ASize | The amount of bytes to allocate |
- Returns
- The beginning of an allocated memory region with size at least
ASize
- Thread Safety
- This function requires no thread safety
- Exceptions
-
- Attention
- Allocations above 2047MB are unsupported
Implemented in CYB::Engine::Memory::Heap.
virtual void CYB::API::Heap::Free |
( |
void *const |
APreviousAllocation | ) |
|
|
pure virtualnoexcept |
Return memory to the heap. Data in allocated range will be lost.
- Parameters
-
APreviousAllocation | A pointer previously returned from a call to Alloc or Realloc of the same Heap object |
- Thread Safety
- This function requires no thread safety
Implemented in CYB::Engine::Memory::Heap.
virtual void* CYB::API::Heap::Realloc |
( |
void *const |
APreviousAllocation, |
|
|
const int |
ANewSize |
|
) |
| |
|
pure virtual |
Allocate memory from the heap for use while preserving previous data. Passing a valid APreviousAllocation
with ANewSize
of zero is equivalent to calling Free(APreviousAllocation
)
- Parameters
-
APreviousAllocation | A pointer previously returned from a call to Alloc or Realloc of the same Heap object |
ANewSize | The amount of bytes to allocate or zero to free an allocation from APreviousAllocation . Must be less than 2047MB |
- Returns
- The beginning of an allocated memory region with size at least
ANewSize
and the data from APreviousAllocation
. Or, if ANewSize
was less than or equal to zero, nullptr
- Thread Safety
- This function requires no thread safety
- Exceptions
-
Implemented in CYB::Engine::Memory::Heap.
The documentation for this class was generated from the following file: