MemoryTracking: make curl_docalloc() call calloc() avoiding our zero fill
This commit is contained in:
parent
4ed7abb537
commit
9710f387c4
@ -48,6 +48,7 @@
|
|||||||
struct memdebug {
|
struct memdebug {
|
||||||
size_t size;
|
size_t size;
|
||||||
union {
|
union {
|
||||||
|
curl_off_t o;
|
||||||
double d;
|
double d;
|
||||||
void * p;
|
void * p;
|
||||||
} mem[1];
|
} mem[1];
|
||||||
@ -166,12 +167,9 @@ void *curl_docalloc(size_t wanted_elements, size_t wanted_size,
|
|||||||
user_size = wanted_size * wanted_elements;
|
user_size = wanted_size * wanted_elements;
|
||||||
size = sizeof(struct memdebug) + user_size;
|
size = sizeof(struct memdebug) + user_size;
|
||||||
|
|
||||||
mem = (Curl_cmalloc)(size);
|
mem = (Curl_ccalloc)(1, size);
|
||||||
if(mem) {
|
if(mem)
|
||||||
/* fill memory with zeroes */
|
|
||||||
memset(mem->mem, 0, user_size);
|
|
||||||
mem->size = user_size;
|
mem->size = user_size;
|
||||||
}
|
|
||||||
|
|
||||||
if(source)
|
if(source)
|
||||||
curl_memlog("MEM %s:%d calloc(%zu,%zu) = %p\n",
|
curl_memlog("MEM %s:%d calloc(%zu,%zu) = %p\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user