summaryrefslogtreecommitdiff
path: root/debug.cc
diff options
context:
space:
mode:
Diffstat (limited to 'debug.cc')
-rw-r--r--debug.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/debug.cc b/debug.cc
index 3b996045..8457ce7d 100644
--- a/debug.cc
+++ b/debug.cc
@@ -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;
}