Source-Changes-HG archive

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

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



details:   https://anonhg.NetBSD.org/src/rev/89d5caa64088
branches:  trunk
changeset: 997489:89d5caa64088
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 aee14c39ba4a -r 89d5caa64088 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 aee14c39ba4a -r 89d5caa64088 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 aee14c39ba4a -r 89d5caa64088 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