summaryrefslogtreecommitdiff
path: root/lib/common/DebugMemLeakFinder.cpp
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2009-04-03 10:52:32 +0000
committerChris Wilson <chris+github@qwirx.com>2009-04-03 10:52:32 +0000
commit2e2a7ed73051d13908f2c2c7179eb5bd8368c76c (patch)
tree81c295754ce5e87f62a35f79703490b8e0adbf24 /lib/common/DebugMemLeakFinder.cpp
parent41ce559afda0c50e8dbe23eedbfce326dfe446e2 (diff)
gcc 4.3 and 4.4 compile fixes, thanks to Reinhard Tartler and the Debian
project. See also: http://patch-tracking.debian.net/package/boxbackup/0.11~rc2+r2072-1 http://lists.warhead.org.uk/pipermail/boxbackup/2009-April/005159.html
Diffstat (limited to 'lib/common/DebugMemLeakFinder.cpp')
-rw-r--r--lib/common/DebugMemLeakFinder.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/common/DebugMemLeakFinder.cpp b/lib/common/DebugMemLeakFinder.cpp
index 230d7163..72891cd1 100644
--- a/lib/common/DebugMemLeakFinder.cpp
+++ b/lib/common/DebugMemLeakFinder.cpp
@@ -24,6 +24,7 @@
#include <stdio.h>
#include <string.h>
#include <set>
+#include <cstdlib> // for std::atexit
#include "MemLeakFinder.h"
@@ -130,7 +131,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;
@@ -146,7 +147,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
@@ -158,7 +159,7 @@ void *memleakfinder_realloc(void *ptr, size_t size)
"objects?");
}
- void *b = ::realloc(ptr, size);
+ void *b = std::realloc(ptr, size);
if(ptr && i!=sMallocBlocks.end())
{
@@ -215,7 +216,7 @@ void memleakfinder_free(void *ptr)
}
//TRACE1("free(), %08x\n", ptr);
- ::free(ptr);
+ std::free(ptr);
}
@@ -426,7 +427,7 @@ void memleakfinder_setup_exit_report(const char *filename, const char *markertex
atexit_markertext[sizeof(atexit_markertext)-1] = 0;
if(!atexit_registered)
{
- atexit(memleakfinder_atexit);
+ std::atexit(memleakfinder_atexit);
atexit_registered = true;
}
}
@@ -490,7 +491,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)
@@ -533,7 +534,7 @@ void internal_delete(void *ptr)
{
InternalAllocGuard guard;
- ::free(ptr);
+ std::free(ptr);
remove_object_block(ptr);
//TRACE1("delete[]() called, %08x\n", ptr);
}