LibC: Don't memset 0 mmap'd callocs

There is no reason to page everything in and the kernel already
guarantees that the memory is zeroed in mmap
This commit is contained in:
2026-07-16 10:24:16 +03:00
parent 33f941f2fd
commit bd5be982e9

View File

@@ -370,7 +370,8 @@ void* calloc(size_t nmemb, size_t size)
if (ptr == nullptr)
return nullptr;
memset(ptr, 0, total);
if (total < s_mmap_threshold)
memset(ptr, 0, total);
return ptr;
}