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.
 

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

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

Variables

JPH_EXPORT AllocateFunction Allocate
 
JPH_EXPORT FreeFunction Free
 
JPH_EXPORT AlignedAllocateFunction AlignedAllocate
 
JPH_EXPORT 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, [[maybe_unused]] 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, [[maybe_unused]] std::align_val_t inAlignment) noexcept { JPH::AlignedFree(inPointer); }
JPH_EXPORT AllocateFunction Allocate
Definition Memory.cpp:59

Macro to override the new and delete functions.

Typedef Documentation

◆ AlignedAllocateFunction

◆ AlignedFreeFunction

◆ AllocateFunction

◆ FreeFunction

Function Documentation

◆ RegisterDefaultAllocator()

JPH_EXPORT void RegisterDefaultAllocator ( )

Register platform default allocation / free functions.

Variable Documentation

◆ AlignedAllocate

JPH_EXPORT AlignedAllocateFunction AlignedAllocate
extern

◆ AlignedFree

JPH_EXPORT AlignedFreeFunction AlignedFree
extern

◆ Allocate

JPH_EXPORT AllocateFunction Allocate
extern

◆ Free

JPH_EXPORT FreeFunction Free
extern