Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
Memory.h File Reference

Go to the source code of this file.

Macros

#define JPH_OVERRIDE_NEW_DELETE
 Macro to override the new and delete functions. More...
 

Typedefs

using AllocateFunction = void *(*)(size_t inSize)
 
using FreeFunction = void(*)(void *inBlock)
 
using AlignedAllocateFunction = void *(*)(size_t inSize, size_t inAlignment)
 
using AlignedFreeFunction = void(*)(void *inBlock)
 

Functions

void RegisterDefaultAllocator ()
 Register platform default allocation / free functions. More...
 

Variables

AllocateFunction Allocate
 
FreeFunction Free
 
AlignedAllocateFunction AlignedAllocate
 
AlignedFreeFunction AlignedFree
 

Macro Definition Documentation

◆ JPH_OVERRIDE_NEW_DELETE

#define JPH_OVERRIDE_NEW_DELETE
Value:
JPH_INLINE void *operator new (size_t inCount) { return JPH::Allocate(inCount); } \
JPH_INLINE void operator delete (void *inPointer) noexcept { JPH::Free(inPointer); } \
JPH_INLINE void *operator new[] (size_t inCount) { return JPH::Allocate(inCount); } \
JPH_INLINE void operator delete[] (void *inPointer) noexcept { JPH::Free(inPointer); } \
JPH_INLINE void *operator new (size_t inCount, std::align_val_t inAlignment) { return JPH::AlignedAllocate(inCount, static_cast<size_t>(inAlignment)); } \
JPH_INLINE void operator delete (void *inPointer, std::align_val_t inAlignment) noexcept { JPH::AlignedFree(inPointer); } \
JPH_INLINE void *operator new[] (size_t inCount, std::align_val_t inAlignment) { return JPH::AlignedAllocate(inCount, static_cast<size_t>(inAlignment)); } \
JPH_INLINE void operator delete[] (void *inPointer, std::align_val_t inAlignment) noexcept { JPH::AlignedFree(inPointer); }

Macro to override the new and delete functions.

Typedef Documentation

◆ AlignedAllocateFunction

using AlignedAllocateFunction = void *(*)(size_t inSize, size_t inAlignment)

◆ AlignedFreeFunction

using AlignedFreeFunction = void (*)(void *inBlock)

◆ AllocateFunction

using AllocateFunction = void *(*)(size_t inSize)

◆ FreeFunction

using FreeFunction = void (*)(void *inBlock)

Function Documentation

◆ RegisterDefaultAllocator()

void RegisterDefaultAllocator ( )

Register platform default allocation / free functions.

Variable Documentation

◆ AlignedAllocate

AlignedAllocateFunction AlignedAllocate
extern

◆ AlignedFree

AlignedFreeFunction AlignedFree
extern

◆ Allocate

AllocateFunction Allocate
extern

◆ Free

FreeFunction Free
extern