aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMax Horn2003-05-21 20:35:48 +0000
committerMax Horn2003-05-21 20:35:48 +0000
commit373679473724d9497bfaef6082883ea855176335 (patch)
tree9903345907c2fb538ff4a9bb82958726c5fc5202 /common
parent4a322125fd3ef8a120f7a71c29eee680c2ec3708 (diff)
downloadscummvm-rg350-373679473724d9497bfaef6082883ea855176335.tar.gz
scummvm-rg350-373679473724d9497bfaef6082883ea855176335.tar.bz2
scummvm-rg350-373679473724d9497bfaef6082883ea855176335.zip
don't inline free_check to make debugging easier
svn-id: r7805
Diffstat (limited to 'common')
-rw-r--r--common/main.cpp9
-rw-r--r--common/scummsys.h8
2 files changed, 10 insertions, 7 deletions
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