diff options
Diffstat (limited to 'lib/Exceptions.cc')
-rw-r--r-- | lib/Exceptions.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc index c46dcfc..3be7c65 100644 --- a/lib/Exceptions.cc +++ b/lib/Exceptions.cc @@ -178,14 +178,23 @@ void * Base::calloc(size_t n, size_t s) { } void * Base::operator new(size_t s) { +#ifdef DEBUG + cerr << "Operator new(s) called. Allocating memory.\n"; +#endif return xmalloc(s); } void * Base::operator new(size_t s, void * p) { +#ifdef DEBUG + printm(M_BARE, "Operator new(s, p) called with p = %p and s = %i. Erasing memory.\n", p, s); +#endif return memset(p, 0, s); } void Base::operator delete(void * p) { +#ifdef DEBUG + printm(M_BARE, "Operator delete(p) called. Freeing memory.\n"); +#endif xfree(p); } |