summaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2015-08-08 21:13:48 +0000
committerChris Wilson <chris+github@qwirx.com>2015-08-08 21:13:48 +0000
commit62c0689012de2786ed2fae3da84b5301d6b49a55 (patch)
tree2999c3506b4bf9cadac4578b51876feb04883d7d /lib/common
parentb70b4b4429e00a42bf7f652d8eeef59c57a741b6 (diff)
Fix memory leak tracking of calloc() allocations
Diffstat (limited to 'lib/common')
-rw-r--r--lib/common/MemLeakFindOn.h1
-rw-r--r--lib/common/MemLeakFinder.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/common/MemLeakFindOn.h b/lib/common/MemLeakFindOn.h
index c20fe25a..f1113184 100644
--- a/lib/common/MemLeakFindOn.h
+++ b/lib/common/MemLeakFindOn.h
@@ -15,6 +15,7 @@
#ifndef MEMLEAKFINDER_MALLOC_MONITORING_DEFINED
#define malloc(X) memleakfinder_malloc(X, __FILE__, __LINE__)
+ #define calloc(X, Y) memleakfinder_calloc(X, Y, __FILE__, __LINE__)
#define realloc memleakfinder_realloc
#define free memleakfinder_free
#define MEMLEAKFINDER_MALLOC_MONITORING_DEFINED
diff --git a/lib/common/MemLeakFinder.h b/lib/common/MemLeakFinder.h
index 3beedbe9..07b52e26 100644
--- a/lib/common/MemLeakFinder.h
+++ b/lib/common/MemLeakFinder.h
@@ -54,7 +54,8 @@ void memleakfinder_notaleak(void *ptr);
void *operator new (size_t size, const char *file, int line);
void *operator new[](size_t size, const char *file, int line);
-// define the malloc functions now, if required
+// Define the malloc functions now, if required. These should match the definitions
+// in MemLeakFindOn.h.
#ifdef MEMLEAKFINDER_FULL_MALLOC_MONITORING
#define malloc(X) memleakfinder_malloc(X, __FILE__, __LINE__)
#define calloc(X, Y) memleakfinder_calloc(X, Y, __FILE__, __LINE__)