From bd7492a47a5bb0ec66a05ae0cff0c9065afb0f88 Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Wed, 12 Jun 2024 13:06:09 -0400 Subject: [PATCH] smalloc: add a comment explaining why scalloc does not zero memory scalloc does not zero out the buffer because this is already done elsewhere. Explain this in a comment because this could be confusing. Signed-off-by: Vincent Fu --- smalloc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smalloc.c b/smalloc.c index 23243054..ac7ef701 100644 --- a/smalloc.c +++ b/smalloc.c @@ -566,6 +566,10 @@ void *smalloc(size_t size) void *scalloc(size_t nmemb, size_t size) { + /* + * smalloc_pool (called by smalloc) will zero the memory, so we don't + * need to do it here. + */ return smalloc(nmemb * size); } -- 2.25.1