From c578a53619e492901d222382e5aa309ae6c9ef1b Mon Sep 17 00:00:00 2001 From: xezon <4720891+xezon@users.noreply.github.com> Date: Thu, 19 Sep 2024 20:32:48 +0200 Subject: [PATCH] Add operator overloads for C++14 delete --- src/game/common/system/gamememory.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/game/common/system/gamememory.cpp b/src/game/common/system/gamememory.cpp index c2ff2bdcd..193e12545 100644 --- a/src/game/common/system/gamememory.cpp +++ b/src/game/common/system/gamememory.cpp @@ -195,7 +195,7 @@ void *operator new[](size_t bytes) return g_dynamicMemoryAllocator->Allocate_Bytes(bytes); } -void operator delete(void *ptr) +void operator delete(void *ptr) noexcept { ++g_theLinkChecker; Init_Memory_Manager_Pre_Main(); @@ -204,7 +204,7 @@ void operator delete(void *ptr) g_dynamicMemoryAllocator->Free_Bytes(ptr); } -void operator delete[](void *ptr) +void operator delete[](void *ptr) noexcept { ++g_theLinkChecker; Init_Memory_Manager_Pre_Main(); @@ -212,3 +212,15 @@ void operator delete[](void *ptr) g_dynamicMemoryAllocator->Free_Bytes(ptr); } + +//#if __cplusplus >= 201402L +void operator delete(void *ptr, size_t sz) noexcept +{ + operator delete(ptr); +} + +void operator delete[](void *ptr, size_t sz) noexcept +{ + operator delete[](ptr); +} +//#endif