>From 417caec6cf798550bdd7752f5ebae129d972e157 Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Fri, 5 Jun 2026 12:04:41 +0000 Subject: [PATCH 2/4] string.h: use builtin memcmp libc.so .text x86_64: +279 667703 riscv64: -16 613155 aarch64: +616 680363 arm: +56 658865 --- src/include/string.h | 1 + src/string/memcmp.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/include/string.h b/src/include/string.h index 997400b0..25ad18bd 100644 --- a/src/include/string.h +++ b/src/include/string.h @@ -11,6 +11,7 @@ hidden char *__strchrnul(const char *, int); #ifdef __GNUC__ #define memcpy(x,y,z) __builtin_memcpy(x,y,z) #define memset(x,y,z) __builtin_memset(x,y,z) +#define memcmp(x,y,z) __builtin_memcmp(x,y,z) #endif #endif diff --git a/src/string/memcmp.c b/src/string/memcmp.c index bdbce9f0..b6124ab9 100644 --- a/src/string/memcmp.c +++ b/src/string/memcmp.c @@ -1,5 +1,6 @@ #include +#undef memcmp int memcmp(const void *vl, const void *vr, size_t n) { const unsigned char *l=vl, *r=vr; -- 2.52.0