From: Vincent Fu Date: Wed, 12 Jun 2024 17:06:09 +0000 (-0400) Subject: smalloc: add a comment explaining why scalloc does not zero memory X-Git-Tag: fio-3.38~51 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=bd7492a47a5bb0ec66a05ae0cff0c9065afb0f88;p=fio.git 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 --- 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); }