Module Name: src Committed By: christos Date: Sun Mar 10 02:49:52 UTC 2019
Modified Files: src/external/bsd/jemalloc/dist/src: jemalloc.c src/external/bsd/jemalloc/include/jemalloc: jemalloc.h src/external/bsd/jemalloc/lib: Makefile.inc Log Message: Make the non-standard jemalloc api weak. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/bsd/jemalloc/dist/src/jemalloc.c cvs rdiff -u -r1.1 -r1.2 \ src/external/bsd/jemalloc/include/jemalloc/jemalloc.h cvs rdiff -u -r1.3 -r1.4 src/external/bsd/jemalloc/lib/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/bsd/jemalloc/dist/src/jemalloc.c diff -u src/external/bsd/jemalloc/dist/src/jemalloc.c:1.2 src/external/bsd/jemalloc/dist/src/jemalloc.c:1.3 --- src/external/bsd/jemalloc/dist/src/jemalloc.c:1.2 Mon Mar 4 12:18:27 2019 +++ src/external/bsd/jemalloc/dist/src/jemalloc.c Sat Mar 9 21:49:52 2019 @@ -1,3 +1,5 @@ +#include <sys/cdefs.h> + #define JEMALLOC_C_ #include "jemalloc/internal/jemalloc_preamble.h" #include "jemalloc/internal/jemalloc_internal_includes.h" @@ -18,6 +20,25 @@ #include "jemalloc/internal/ticker.h" #include "jemalloc/internal/util.h" +__weak_alias(mallocx, je_mallocx) +__weak_alias(rallocx, je_rallocx) +__weak_alias(xallocx, je_xallocx) +__weak_alias(sallocx, je_sallocx) +__weak_alias(dallocx, je_dallocx) +__weak_alias(sdallocx, je_sdallocx) +__weak_alias(nallocx, je_nallocx) + +__weak_alias(mallctl, je_mallctl) +__weak_alias(mallctltomib, je_mallctltomib) +__weak_alias(mallctlbymib, je_mallctlbymib) + +__weak_alias(malloc_stats_print, je_malloc_stats_print) +__weak_alias(malloc_usable_size, je_malloc_usable_size) + +__weak_alias(malloc_message, je_malloc_message) + +__weak_alias(malloc_conf, je_malloc_conf) + /******************************************************************************/ /* Data. */ Index: src/external/bsd/jemalloc/include/jemalloc/jemalloc.h diff -u src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.1 src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.2 --- src/external/bsd/jemalloc/include/jemalloc/jemalloc.h:1.1 Mon Mar 4 12:25:09 2019 +++ src/external/bsd/jemalloc/include/jemalloc/jemalloc.h Sat Mar 9 21:49:52 2019 @@ -83,6 +83,29 @@ extern "C" { # define je_valloc valloc #endif +#ifdef JEMALLOC_WEAK_NOSTD + +#undef je_mallocx +#undef je_rallocx +#undef je_xallocx +#undef je_sallocx +#undef je_dallocx +#undef je_sdallocx +#undef je_nallocx + +#undef je_mallctl +#undef je_mallctltomib +#undef je_mallctlbymib + +#undef je_malloc_stats_print +#undef je_malloc_usable_size + +#undef je_malloc_message + +#undef je_malloc_conf + +#endif + #include <stdlib.h> #include <stdbool.h> #include <stdint.h> Index: src/external/bsd/jemalloc/lib/Makefile.inc diff -u src/external/bsd/jemalloc/lib/Makefile.inc:1.3 src/external/bsd/jemalloc/lib/Makefile.inc:1.4 --- src/external/bsd/jemalloc/lib/Makefile.inc:1.3 Fri Mar 8 15:00:21 2019 +++ src/external/bsd/jemalloc/lib/Makefile.inc Sat Mar 9 21:49:52 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.3 2019/03/08 20:00:21 christos Exp $ +# $NetBSD: Makefile.inc,v 1.4 2019/03/10 02:49:52 christos Exp $ JEMALLOC:=${.PARSEDIR}/.. @@ -38,7 +38,8 @@ witness.c .SUFFIXES: .3 .PATH.3: ${JEMALLOC}/dist/doc .for i in ${JEMALLOC_SRCS} -CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_NO_PRIVATE_NAMESPACE +CPPFLAGS.${i}+=-I${JEMALLOC}/include -DJEMALLOC_NO_PRIVATE_NAMESPACE \ + -DJEMALLOC_WEAK_NOSTD COPTS.${i}+= -fvisibility=hidden -funroll-loops .endfor