Skip to content

Commit

Permalink
Added placement delete operators (#1405)
Browse files Browse the repository at this point in the history
Fixes #1402
  • Loading branch information
jrouwe authored Dec 20, 2024
1 parent de0b2e9 commit 27559da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Jolt/Core/Memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ JPH_EXPORT void RegisterDefaultAllocator();
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_INLINE void *operator new ([[maybe_unused]] size_t inSize, void *inPointer) noexcept { return inPointer; } \
JPH_INLINE void *operator new[] ([[maybe_unused]] size_t inSize, void *inPointer) noexcept { return inPointer; }
JPH_INLINE void *operator new ([[maybe_unused]] size_t inCount, void *inPointer) noexcept { return inPointer; } \
JPH_INLINE void operator delete ([[maybe_unused]] void *inPointer, [[maybe_unused]] void *inPlace) noexcept { /* Do nothing */ } \
JPH_INLINE void *operator new[] ([[maybe_unused]] size_t inCount, void *inPointer) noexcept { return inPointer; } \
JPH_INLINE void operator delete[] ([[maybe_unused]] void *inPointer, [[maybe_unused]] void *inPlace) noexcept { /* Do nothing */ }

#else

Expand Down

0 comments on commit 27559da

Please sign in to comment.