From 373679473724d9497bfaef6082883ea855176335 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 21 May 2003 20:35:48 +0000 Subject: don't inline free_check to make debugging easier svn-id: r7805 --- common/main.cpp | 9 +++++++++ common/scummsys.h | 8 +------- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'common') diff --git a/common/main.cpp b/common/main.cpp index 22236f43d6..4091eca481 100644 --- a/common/main.cpp +++ b/common/main.cpp @@ -240,4 +240,13 @@ void *operator new(size_t size) { void operator delete(void *ptr) { free(ptr); } + +#undef free(x) +void free_check(void *ptr) { + if ((uint)ptr == 0xE7E7E7E7UL) { + printf("ERROR: freeing 0xE7E7E7E7\n"); + exit(1); + } + free(ptr); +} #endif diff --git a/common/scummsys.h b/common/scummsys.h index 224df158ff..95cdd0d57b 100644 --- a/common/scummsys.h +++ b/common/scummsys.h @@ -437,14 +437,8 @@ void operator delete(void *ptr); // Since 'new' now returns a memory block inited to 0xE7E7E7E7 we might // get some invocations of free() with that param. We check for those here. // That allows us to set a debugger breakpoint to catch it. -inline void free_check(void *ptr) { - if ((uint)ptr == 0xE7E7E7E7UL) { - printf("ERROR: freeing 0xE7E7E7E7\n"); - exit(1); - } - free(ptr); -} #define free(x) free_check(x) +void free_check(void *ptr); #endif #endif -- cgit v1.2.3