ReactPhysics3D  v0.10.2
C++ Physics engine library
Loading...
Searching...
No Matches
reactphysics3d::HeapAllocator Class Reference

This class is used to efficiently allocate memory on the heap. More...

#include <include/reactphysics3d/memory/HeapAllocator.h>

Inheritance diagram for reactphysics3d::HeapAllocator:
reactphysics3d::MemoryAllocator

Public Member Functions

 HeapAllocator (MemoryAllocator &baseAllocator, size_t initAllocatedMemory=0)
 Constructor.
 
virtual ~HeapAllocator () override
 Destructor.
 
HeapAllocatoroperator= (HeapAllocator &allocator)=delete
 Assignment operator.
 
virtual void * allocate (size_t size) override
 Allocate memory of a given size (in bytes) and return a pointer to the allocated memory.
 
virtual void release (void *pointer, size_t size) override
 Release previously allocated memory.
 
- Public Member Functions inherited from reactphysics3d::MemoryAllocator
 MemoryAllocator ()=default
 Constructor.
 
virtual ~MemoryAllocator ()=default
 Destructor.
 
MemoryAllocatoroperator= (MemoryAllocator &allocator)=default
 Assignment operator.
 

Additional Inherited Members

- Static Public Member Functions inherited from reactphysics3d::MemoryAllocator
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.
 

Detailed Description

This class is used to efficiently allocate memory on the heap.

It is used to allocate memory that cannot be allocated in a single frame allocator or a pool allocator.

Member Function Documentation

◆ allocate()

void * HeapAllocator::allocate ( size_t  size)
overridevirtual

Allocate memory of a given size (in bytes) and return a pointer to the allocated memory.

Implements reactphysics3d::MemoryAllocator.

◆ release()

void HeapAllocator::release ( void *  pointer,
size_t  size 
)
overridevirtual

Release previously allocated memory.

Implements reactphysics3d::MemoryAllocator.


The documentation for this class was generated from the following files: