mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
malloc: Optimize small memory clearing for calloc
Add calloc-clear-memory.h to clear memory size up to 36 bytes (72 bytes on 64-bit targets) for calloc. Use repeated stores with 1 branch, instead of up to 3 branches. On x86-64, it is faster than memset since calling memset needs 1 indirect branch, 1 broadcast, and up to 4 branches. Signed-off-by: H.J. Lu <hjl.tools@gmail.com> Reviewed-by: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
#include <malloc-sysdep.h>
|
||||
#include <malloc-size.h>
|
||||
#include <malloc-hugepages.h>
|
||||
#include <calloc-clear-memory.h>
|
||||
|
||||
/* Called in the parent process before a fork. */
|
||||
void __malloc_fork_lock_parent (void) attribute_hidden;
|
||||
|
Reference in New Issue
Block a user