diff options
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; } |