diff options
author | Chris Wilson <chris+github@qwirx.com> | 2013-09-19 23:07:36 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2013-09-19 23:07:36 +0000 |
commit | f2c9e2fbd251736b50f88cea07e8a97635b5c6fa (patch) | |
tree | 5ec1dc3e8f841a526a9fed256d03b3f5d259ad7f /lib/common/DebugMemLeakFinder.cpp | |
parent | 93966139dbfc1ee289718087c4a232dd44d337f7 (diff) |
Add calloc() support to memory leak finder.
Diffstat (limited to 'lib/common/DebugMemLeakFinder.cpp')
-rw-r--r-- | lib/common/DebugMemLeakFinder.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/common/DebugMemLeakFinder.cpp b/lib/common/DebugMemLeakFinder.cpp index a4f8d41e..0b123675 100644 --- a/lib/common/DebugMemLeakFinder.cpp +++ b/lib/common/DebugMemLeakFinder.cpp @@ -164,6 +164,16 @@ void *memleakfinder_malloc(size_t size, const char *file, int line) return b; } +void *memleakfinder_calloc(size_t blocks, size_t size, const char *file, int line) +{ + void *block = memleakfinder_malloc(blocks * size, file, line); + if (block != 0) + { + memset(block, 0, blocks * size); + } + return block; +} + void *memleakfinder_realloc(void *ptr, size_t size) { InternalAllocGuard guard; |