optimize calloc when zero on free is disabled

This commit is contained in:
Daniel Micay 2018-09-07 16:32:51 -04:00
parent 8f921e30be
commit 9a1acce5eb

View File

@ -785,7 +785,7 @@ EXPORT void *h_calloc(size_t nmemb, size_t size) {
if (unlikely(p == NULL)) {
return NULL;
}
if (size) {
if (size && size <= max_slab_size_class) {
memset(p, 0, total_size - canary_size);
}
return p;