Abstract class with the basic interface of all the derived memory allocators.
More...
#include <include/reactphysics3d/memory/MemoryAllocator.h>
|
| MemoryAllocator ()=default |
| Constructor.
|
|
virtual | ~MemoryAllocator ()=default |
| Destructor.
|
|
MemoryAllocator & | operator= (MemoryAllocator &allocator)=default |
| Assignment operator.
|
|
virtual void * | allocate (size_t size)=0 |
| Allocate memory of a given size (in bytes) and return a pointer to the allocated memory.
|
|
virtual void | release (void *pointer, size_t size)=0 |
| Release previously allocated memory.
|
|
|
static void * | alignAddress (void *pointer, uint8 alignment) |
| Given a pointer to memory, this method returns the next aligned address.
|
|
static void * | alignAddress (void *pointer, uint8 alignment, ptrdiff_t &alignmentOffset) |
| Given a pointer to memory, this method returns the next aligned address and also output the alignment offset.
|
|
Abstract class with the basic interface of all the derived memory allocators.
◆ alignAddress() [1/2]
void * MemoryAllocator::alignAddress |
( |
void * |
pointer, |
|
|
uint8 |
alignment |
|
) |
| |
|
static |
Given a pointer to memory, this method returns the next aligned address.
- Parameters
-
pointer | Pointer to a memory location |
alignment | Desired alignment |
- Returns
- Pointer to the next aligned memory location
◆ alignAddress() [2/2]
void * MemoryAllocator::alignAddress |
( |
void * |
pointer, |
|
|
uint8 |
alignment, |
|
|
ptrdiff_t & |
outAlignmentOffset |
|
) |
| |
|
static |
Given a pointer to memory, this method returns the next aligned address and also output the alignment offset.
- Parameters
-
pointer | Pointer to a memory location |
alignment | Desired alignment |
outAlignmentOffset | Output alignment offset needed to align the initial pointer |
- Returns
- Pointer to the next aligned memory location
◆ allocate()
virtual void * reactphysics3d::MemoryAllocator::allocate |
( |
size_t |
size | ) |
|
|
pure virtual |
◆ release()
virtual void reactphysics3d::MemoryAllocator::release |
( |
void * |
pointer, |
|
|
size_t |
size |
|
) |
| |
|
pure virtual |
The documentation for this class was generated from the following files:
- include/reactphysics3d/memory/MemoryAllocator.h
- src/memory/MemoryAllocator.cpp