optimize calloc when zero on free is disabled
parent
8f921e30be
commit
9a1acce5eb
2
malloc.c
2
malloc.c
|
@ -785,7 +785,7 @@ EXPORT void *h_calloc(size_t nmemb, size_t size) {
|
||||||
if (unlikely(p == NULL)) {
|
if (unlikely(p == NULL)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (size) {
|
if (size && size <= max_slab_size_class) {
|
||||||
memset(p, 0, total_size - canary_size);
|
memset(p, 0, total_size - canary_size);
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
|
|
Loading…
Reference in New Issue