diff options
Diffstat (limited to 'lib/debug.cpp')
-rw-r--r-- | lib/debug.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/debug.cpp b/lib/debug.cpp index 474e83d..f2c3700 100644 --- a/lib/debug.cpp +++ b/lib/debug.cpp @@ -16,6 +16,18 @@ #include <gras_impl/debug.hpp> +#ifdef MALLOC_DEBUG +#include <cstdio> +#include <cstdlib> + +void *operator new(std::size_t n) throw (std::bad_alloc) +{ + //static int malloc_count = 0; + //printf("malloc #%d -> size %u\n", malloc_count++, n); + return std::malloc(n); +} +#endif + #ifdef ASSERTING struct DebugAssertPrinter |