![]() |
Jolt Physics
A multi core friendly Game Physics Engine
|
#include <TempAllocator.h>
Public Member Functions | |
| virtual | ~TempAllocator ()=default |
| Destructor. | |
| virtual void * | Allocate (uint inSize)=0 |
| Allocates inSize bytes of memory, returned memory address must be JPH_RVECTOR_ALIGNMENT byte aligned. | |
| virtual void | Free (void *inAddress, uint inSize)=0 |
| Frees inSize bytes of memory located at inAddress. | |
Public Member Functions inherited from NonCopyable | |
| NonCopyable ()=default | |
| NonCopyable (const NonCopyable &)=delete | |
| void | operator= (const NonCopyable &)=delete |
Static Public Attributes | |
| static JPH_OVERRIDE_NEW_DELETE constexpr bool | needs_aligned_allocate = JPH_RVECTOR_ALIGNMENT > (JPH_CPU_ADDRESS_BITS == 32? 8 : 16) |
| If this allocator needs to fall back to aligned allocations because JPH_RVECTOR_ALIGNMENT is bigger than the platform default. | |
Allocator for temporary allocations. This allocator works as a stack: The blocks must always be freed in the reverse order as they are allocated. Note that allocations and frees can take place from different threads, but the order is guaranteed though job dependencies, so it is not needed to use any form of locking.
|
virtualdefault |
Destructor.
|
pure virtual |
Allocates inSize bytes of memory, returned memory address must be JPH_RVECTOR_ALIGNMENT byte aligned.
Implemented in TempAllocatorImpl, TempAllocatorImplWithMallocFallback, and TempAllocatorMalloc.
|
pure virtual |
Frees inSize bytes of memory located at inAddress.
Implemented in TempAllocatorImpl, TempAllocatorImplWithMallocFallback, and TempAllocatorMalloc.
|
staticconstexpr |
If this allocator needs to fall back to aligned allocations because JPH_RVECTOR_ALIGNMENT is bigger than the platform default.