From f0aef1f7124d9300965168e79ec80af8ace568a1 Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Sat, 21 Oct 2023 08:19:27 +0100 Subject: [PATCH] [+] AU_DEBUG_REVERSE_MEMCRUNCH --- Include/Aurora/Debug/MemoryCrunch.hpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Include/Aurora/Debug/MemoryCrunch.hpp b/Include/Aurora/Debug/MemoryCrunch.hpp index 640606b4..ce27fb46 100644 --- a/Include/Aurora/Debug/MemoryCrunch.hpp +++ b/Include/Aurora/Debug/MemoryCrunch.hpp @@ -25,5 +25,19 @@ namespace Aurora::Debug } }; + struct MemoryCrunchCallOut + { + inline MemoryCrunchCallOut() + { + DecMemoryCrunch(); + } + + inline ~MemoryCrunchCallOut() + { + AddMemoryCrunch(); + } + }; + #define AU_DEBUG_MEMCRUNCH Aurora::Debug::MemoryCrunch AU_CONCAT(__crunch, __COUNTER__); +#define AU_DEBUG_REVERSE_MEMCRUNCH Aurora::Debug::MemoryCrunchCallOut AU_CONCAT(__crunch, __COUNTER__); } \ No newline at end of file