diff options
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | lib/common/DebugMemLeakFinder.cpp | 16 |
2 files changed, 11 insertions, 12 deletions
diff --git a/debian/changelog b/debian/changelog index 767147dd..c3aff9cb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,9 +2,10 @@ boxbackup (0.11~rc2-5) unstable; urgency=low * Bugfix: "Please build-depend on docbook-xml". Thanks to Luca Falavigna <dktrkranz@ubuntu.com> for reporting. Closes: #507973 - * Add missing #include in lib/common/Logging.cpp. define - MEMLEAKFINDER_FULL_MALLOC_MONITORING in - lib/common/DebugMemLeakFinder.cpp. Closes: #505696, #512510 + * Add missing #includes in lib/common/Logging.cpp and + lib/common/DebugMemLeakFinder.cpp. Also use malloc, free, etc from the + namespace std:: instead of the global namespace + Closes: #505696, #512510 -- Reinhard Tartler <siretart@tauware.de> Thu, 22 Jan 2009 08:26:24 +0100 diff --git a/lib/common/DebugMemLeakFinder.cpp b/lib/common/DebugMemLeakFinder.cpp index 501748b8..1527661f 100644 --- a/lib/common/DebugMemLeakFinder.cpp +++ b/lib/common/DebugMemLeakFinder.cpp @@ -64,8 +64,6 @@ #include <string.h> #include <set> -// c.f. http://bugs.debian.org/512510 -#define MEMLEAKFINDER_FULL_MALLOC_MONITORING 1 #include "MemLeakFinder.h" static bool memleakfinder_initialised = false; @@ -164,7 +162,7 @@ void *memleakfinder_malloc(size_t size, const char *file, int line) { InternalAllocGuard guard; - void *b = ::malloc(size); + void *b = std::malloc(size); if(!memleakfinder_global_enable) return b; if(!memleakfinder_initialised) return b; @@ -180,7 +178,7 @@ void *memleakfinder_realloc(void *ptr, size_t size) if(!memleakfinder_global_enable || !memleakfinder_initialised) { - return ::realloc(ptr, size); + return std::realloc(ptr, size); } // Check it's been allocated @@ -190,7 +188,7 @@ void *memleakfinder_realloc(void *ptr, size_t size) TRACE1("Block %x realloc(), but not in list. Error? Or allocated in startup static objects?\n", ptr); } - void *b = ::realloc(ptr, size); + void *b = std::realloc(ptr, size); if(ptr && i!=sMallocBlocks.end()) { @@ -245,7 +243,7 @@ void memleakfinder_free(void *ptr) } //TRACE1("free(), %08x\n", ptr); - ::free(ptr); + std::free(ptr); } @@ -435,7 +433,7 @@ void memleakfinder_setup_exit_report(const char *filename, const char *markertex ::strcpy(atexit_markertext, markertext); if(!atexit_registered) { - atexit(memleakfinder_atexit); + std:atexit(memleakfinder_atexit); atexit_registered = true; } } @@ -499,7 +497,7 @@ static void *internal_new(size_t size, const char *file, int line) { InternalAllocGuard guard; - r = ::malloc(size); + r = std::malloc(size); } if (sInternalAllocDepth == 0) @@ -542,7 +540,7 @@ void internal_delete(void *ptr) { InternalAllocGuard guard; - ::free(ptr); + std::free(ptr); remove_object_block(ptr); //TRACE1("delete[]() called, %08x\n", ptr); } |