diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-20 02:13:48 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:28 -0400 |
commit | 539370ff1b37772e9f11439f652ffd3583beeedb (patch) | |
tree | 69e8b0a0aee571d7335eae4c6693829745de1484 /debug.cc | |
parent | 0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c (diff) | |
download | fork-ledger-539370ff1b37772e9f11439f652ffd3583beeedb.tar.gz fork-ledger-539370ff1b37772e9f11439f652ffd3583beeedb.tar.bz2 fork-ledger-539370ff1b37772e9f11439f652ffd3583beeedb.zip |
More refactoring
Diffstat (limited to 'debug.cc')
-rw-r--r-- | debug.cc | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -25,54 +25,70 @@ std::map<void *, int> ptrs; void * operator new(std::size_t size) throw (std::bad_alloc) { void * ptr = std::malloc(size); +#if 0 // jww (2007-04-19): these don't work with boost::regex if (DEBUG("debug.alloc")) { PRINT_INC("void * operator new(std::size_t size) throw (std::bad_alloc)\n"); } +#endif return ptr; } void * operator new[](std::size_t size) throw (std::bad_alloc) { void * ptr = std::malloc(size); +#if 0 if (DEBUG("debug.alloc")) { PRINT_INC("void * operator new[](std::size_t) throw (std::bad_alloc)\n"); } +#endif return ptr; } void * operator new(std::size_t size, const std::nothrow_t&) throw() { void * ptr = std::malloc(size); +#if 0 if (DEBUG("debug.alloc")) { PRINT_INC("void * operator new(std::size_t size, const std::nothrow_t&) throw()\n"); } +#endif return ptr; } void * operator new[](std::size_t size, const std::nothrow_t&) throw() { void * ptr = std::malloc(size); +#if 0 if (DEBUG("debug.alloc")) { PRINT_INC("void * operator new[](std::size_t size, const std::nothrow_t&) throw()\n"); } +#endif return ptr; } void operator delete(void * ptr) throw() { +#if 0 if (DEBUG("debug.alloc")) { PRINT_DEC("void operator delete(void * ptr) throw()\n"); } +#endif std::free(ptr); } void operator delete[](void * ptr) throw() { +#if 0 if (DEBUG("debug.alloc")) { PRINT_DEC("void operator delete[](void * ptr) throw()\n"); } +#endif std::free(ptr); } void operator delete(void * ptr, const std::nothrow_t&) throw() { +#if 0 if (DEBUG("debug.alloc")) { PRINT_DEC("void operator delete(void * ptr, const std::nothrow_t&) throw()\n"); } +#endif std::free(ptr); } void operator delete[](void * ptr, const std::nothrow_t&) throw() { +#if 0 if (DEBUG("debug.alloc")) { PRINT_DEC("void operator delete[](void * ptr, const std::nothrow_t&) throw()\n"); } +#endif std::free(ptr); } @@ -81,8 +97,7 @@ bool _free_debug_stream = false; bool _debug_active(const char * const cls) { if (char * debug = std::getenv("DEBUG_CLASS")) { - static boost::regex class_regexp(debug); - return boost::regex_match(cls, class_regexp); + return boost::regex_match(cls, boost::regex(debug)); } return false; } |