From 441c5d0f8727cdc3415d57fcc0c26d07748c759b Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Wed, 5 Oct 2022 12:49:19 -0400 Subject: [PATCH 1/4] src/jemalloc.c: Use %u for unsigned values --- src/jemalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jemalloc.c b/src/jemalloc.c index a4761c9b..60fb901f 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -2034,7 +2034,7 @@ malloc_init_narenas(void) { } else { if (ncpus >= MALLOCX_ARENA_LIMIT) { malloc_printf(": narenas w/ percpu" - "arena beyond limit (%d)\n", ncpus); + "arena beyond limit (%u)\n", ncpus); if (opt_abort) { abort(); } @@ -2082,7 +2082,7 @@ malloc_init_narenas(void) { */ if (narenas_auto >= MALLOCX_ARENA_LIMIT) { narenas_auto = MALLOCX_ARENA_LIMIT - 1; - malloc_printf(": Reducing narenas to limit (%d)\n", + malloc_printf(": Reducing narenas to limit (%u)\n", narenas_auto); } narenas_total_set(narenas_auto); From 94874781ae3cd74ff5799a727e344783ab81dbbe Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Wed, 5 Oct 2022 16:31:40 -0400 Subject: [PATCH 2/4] src/jemalloc.c: Use GCC's copy() to duplicate all attributes --- src/jemalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jemalloc.c b/src/jemalloc.c index 60fb901f..134a35c3 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -3334,7 +3334,7 @@ JEMALLOC_EXPORT void *(*__memalign_hook)(size_t alignment, size_t size) = * be implemented also, so none of glibc's malloc.o functions are added to the * link. */ -# define ALIAS(je_fn) __attribute__((alias (#je_fn), used)) +# define ALIAS(je_fn) __attribute__((alias (#je_fn), copy(je_fn))) /* To force macro expansion of je_ prefix before stringification. */ # define PREALIAS(je_fn) ALIAS(je_fn) # ifdef JEMALLOC_OVERRIDE___LIBC_CALLOC From 4575c2b19ec5e1ee485703c35811a08194ef6842 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Tue, 11 Oct 2022 14:39:50 -0400 Subject: [PATCH 3/4] src/jemalloc.c: Avoid copy() attribute in Clang --- src/jemalloc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/jemalloc.c b/src/jemalloc.c index 134a35c3..5076e5ea 100644 --- a/src/jemalloc.c +++ b/src/jemalloc.c @@ -3334,7 +3334,12 @@ JEMALLOC_EXPORT void *(*__memalign_hook)(size_t alignment, size_t size) = * be implemented also, so none of glibc's malloc.o functions are added to the * link. */ -# define ALIAS(je_fn) __attribute__((alias (#je_fn), copy(je_fn))) +# ifdef __clang__ + /* Clang doesn't support GCC's copy() attribute. */ +# define ALIAS(je_fn) __attribute__((alias (#je_fn), used)) +# else +# define ALIAS(je_fn) __attribute__((alias (#je_fn), copy(je_fn))) +# endif /* To force macro expansion of je_ prefix before stringification. */ # define PREALIAS(je_fn) ALIAS(je_fn) # ifdef JEMALLOC_OVERRIDE___LIBC_CALLOC From fc4a4d74eb3d79afbd57f06a9321c398ed1bc310 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Fri, 14 Oct 2022 13:00:12 -0400 Subject: [PATCH 4/4] jemalloc_internal_defs.h.in: Add missing JEMALLOC_INTERNAL_POPCOUNTLL --- include/jemalloc/internal/jemalloc_internal_defs.h.in | 1 + 1 file changed, 1 insertion(+) diff --git a/include/jemalloc/internal/jemalloc_internal_defs.h.in b/include/jemalloc/internal/jemalloc_internal_defs.h.in index f5d94ee7..b1e8685d 100644 --- a/include/jemalloc/internal/jemalloc_internal_defs.h.in +++ b/include/jemalloc/internal/jemalloc_internal_defs.h.in @@ -245,6 +245,7 @@ /* * popcount*() functions to use for bitmapping. */ +#undef JEMALLOC_INTERNAL_POPCOUNTLL #undef JEMALLOC_INTERNAL_POPCOUNTL #undef JEMALLOC_INTERNAL_POPCOUNT