From 9a1acce5eb2772fbaddd1fa75e4fa18490bd9f4b Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Fri, 7 Sep 2018 16:32:51 -0400 Subject: [PATCH] optimize calloc when zero on free is disabled --- malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/malloc.c b/malloc.c index a9ec5f4..f8efc97 100644 --- a/malloc.c +++ b/malloc.c @@ -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;