ReactPhysics3D  v0.10.1
C++ Physics engine library
reactphysics3d::DefaultAllocator Class Reference

This class represents a default memory allocator that uses standard C++ functions to allocated 16-bytes aligned memory. More...

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

Inheritance diagram for reactphysics3d::DefaultAllocator:
reactphysics3d::MemoryAllocator

Public Member Functions

virtual ~DefaultAllocator () override=default
 Destructor.
 
DefaultAllocatoroperator= (DefaultAllocator &allocator)=default
 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. More...
 
virtual void release (void *pointer, size_t) 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. More...
 
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. More...
 

Detailed Description

This class represents a default memory allocator that uses standard C++ functions to allocated 16-bytes aligned memory.

Member Function Documentation

◆ allocate()

virtual void* reactphysics3d::DefaultAllocator::allocate ( size_t  size)
inlineoverridevirtual

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

The returned allocated memory must be 16 bytes aligned.

Implements reactphysics3d::MemoryAllocator.


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