Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/jemalloc Make the non-standard jemalloc api weak.



details:   https://anonhg.NetBSD.org/src/rev/567228db8e03
branches:  trunk
changeset: 449531:567228db8e03
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Mar 10 02:49:52 2019 +0000

description:
Make the non-standard jemalloc api weak.

diffstat:

 external/bsd/jemalloc/dist/src/jemalloc.c         |  21 +++++++++++++++++++++
 external/bsd/jemalloc/include/jemalloc/jemalloc.h |  23 +++++++++++++++++++++++
 external/bsd/jemalloc/lib/Makefile.inc            |   5 +++--
 3 files changed, 47 insertions(+), 2 deletions(-)

diffs (87 lines):

diff -r 78f57739b67e -r 567228db8e03 external/bsd/jemalloc/dist/src/jemalloc.c
--- a/external/bsd/jemalloc/dist/src/jemalloc.c Sun Mar 10 02:29:52 2019 +0000
+++ b/external/bsd/jemalloc/dist/src/jemalloc.c Sun Mar 10 02:49:52 2019 +0000
@@ -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. */
 
diff -r 78f57739b67e -r 567228db8e03 external/bsd/jemalloc/include/jemalloc/jemalloc.h
--- a/external/bsd/jemalloc/include/jemalloc/jemalloc.h Sun Mar 10 02:29:52 2019 +0000
+++ b/external/bsd/jemalloc/include/jemalloc/jemalloc.h Sun Mar 10 02:49:52 2019 +0000
@@ -83,6 +83,29 @@
 #  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>
diff -r 78f57739b67e -r 567228db8e03 external/bsd/jemalloc/lib/Makefile.inc
--- a/external/bsd/jemalloc/lib/Makefile.inc    Sun Mar 10 02:29:52 2019 +0000
+++ b/external/bsd/jemalloc/lib/Makefile.inc    Sun Mar 10 02:49:52 2019 +0000
@@ -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 @@
 .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
 



Home | Main Index | Thread Index | Old Index