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:
@@ -370,7 +370,8 @@ void* calloc(size_t nmemb, size_t size)
|
|||||||
if (ptr == nullptr)
|
if (ptr == nullptr)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
memset(ptr, 0, total);
|
if (total < s_mmap_threshold)
|
||||||
|
memset(ptr, 0, total);
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user