From 27559da08bab455dcb733dfd4b0b16143981041d Mon Sep 17 00:00:00 2001 From: Jorrit Rouwe Date: Fri, 20 Dec 2024 09:55:49 +0100 Subject: [PATCH] Added placement delete operators (#1405) Fixes #1402 --- Jolt/Core/Memory.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jolt/Core/Memory.h b/Jolt/Core/Memory.h index 3f68f3a06..b5f318db1 100644 --- a/Jolt/Core/Memory.h +++ b/Jolt/Core/Memory.h @@ -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(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