mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09:00
AK+Kernel: Avoid double memory clearing of HashTable buckets
Since the allocated memory is going to be zeroed immediately anyway, let's avoid redundantly scrubbing it with MALLOC_SCRUB_BYTE just before that. The latest versions of gcc and Clang can automatically do this malloc + memset -> calloc optimization, but I've seen a couple of places where it failed to be done. This commit also adds a naive kcalloc function to the kernel that doesn't (yet) eliminate the redundancy like the userland does.
This commit is contained in:
parent
cd21e03225
commit
e3eb68dd58
Notes:
sideshowbarker
2024-07-17 17:23:55 +09:00
Author: https://github.com/BertalanD
Commit: e3eb68dd58
Pull-request: https://github.com/SerenityOS/serenity/pull/13051
4 changed files with 15 additions and 2 deletions
|
@ -15,6 +15,7 @@
|
|||
# include <new>
|
||||
# include <stdlib.h>
|
||||
|
||||
# define kcalloc calloc
|
||||
# define kmalloc malloc
|
||||
# define kmalloc_good_size malloc_good_size
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue