From 1a5d901e025e3570350f082c98d09da748e919b4 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 17 Dec 1996 01:23:36 +0000 Subject: [PATCH] lilypond-0.0.17 --- src/debug.cc | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/debug.cc b/src/debug.cc index 7620027c91..eaed33f080 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1,5 +1,6 @@ #include #include +#include #include "debug.hh" #include "dstream.hh" #include "vector.hh" @@ -33,3 +34,34 @@ set_debug(bool b) { check_debug =b; } + + +#if 0 // want to debug mem functions + + +/// +static +void foobulize(void *p , size_t s) +{ +// assert(s < 2000000); + memset(p, 0xf0, s); +} +/** + trash a portion of memory. Make sure access to deleted stuff is bogus. + */ +void * +operator new (size_t s) +{ + void *p = malloc(s); + assert(p); +// foobulize(p,s); + return p; +} + +void +operator delete(void *p, size_t s) +{ + foobulize(p,s); + free(p); +} +#endif -- 2.39.5