summaryrefslogtreecommitdiff
path: root/lib/memdebug.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-08-16 22:24:23 +0200
committerYang Tse <yangsita@gmail.com>2011-08-16 22:24:23 +0200
commit9710f387c40b4f911c2522f024155516fa8ab3e7 (patch)
treebfaca8868e12c4ca6a5a31bf46e9d8e0c32feeb6 /lib/memdebug.c
parent4ed7abb5370a94160b7b9d7e4d858e2e5471d172 (diff)
downloadcurl-9710f387c40b4f911c2522f024155516fa8ab3e7.tar.gz
MemoryTracking: make curl_docalloc() call calloc() avoiding our zero fill
Diffstat (limited to 'lib/memdebug.c')
-rw-r--r--lib/memdebug.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/memdebug.c b/lib/memdebug.c
index 3e3c1bc4f..e0c0d2825 100644
--- a/lib/memdebug.c
+++ b/lib/memdebug.c
@@ -48,6 +48,7 @@
struct memdebug {
size_t size;
union {
+ curl_off_t o;
double d;
void * p;
} mem[1];
@@ -166,12 +167,9 @@ void *curl_docalloc(size_t wanted_elements, size_t wanted_size,
user_size = wanted_size * wanted_elements;
size = sizeof(struct memdebug) + user_size;
- mem = (Curl_cmalloc)(size);
- if(mem) {
- /* fill memory with zeroes */
- memset(mem->mem, 0, user_size);
+ mem = (Curl_ccalloc)(1, size);
+ if(mem)
mem->size = user_size;
- }
if(source)
curl_memlog("MEM %s:%d calloc(%zu,%zu) = %p\n",