From b0fd5016db74678476868abb380170b319a50480 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Sun, 17 Jan 2010 01:49:20 -0800 Subject: [PATCH] Add the --with-install-suffix configure option. Fix some bugs in the Makefile's install target. --- .gitignore | 4 + jemalloc/INSTALL | 5 ++ jemalloc/Makefile.in | 41 +++++----- jemalloc/configure.ac | 62 ++++++++++---- jemalloc/doc/jemalloc.3.in | 6 +- jemalloc/src/{ => internal}/jemalloc_arena.h | 0 jemalloc/src/{ => internal}/jemalloc_base.h | 0 jemalloc/src/{ => internal}/jemalloc_chunk.h | 0 jemalloc/src/{ => internal}/jemalloc_extent.h | 0 jemalloc/src/{ => internal}/jemalloc_huge.h | 0 .../jemalloc_internal.h.in} | 80 +++++++++---------- jemalloc/src/{ => internal}/jemalloc_mutex.h | 0 jemalloc/src/{ => internal}/jemalloc_stats.h | 0 jemalloc/src/{ => internal}/jemalloc_tcache.h | 0 jemalloc/src/{ => internal}/jemalloc_trace.h | 0 jemalloc/src/internal/mtrgraph_defs.h.in | 14 ++++ jemalloc/src/internal/mtrplay_defs.h.in | 14 ++++ jemalloc/src/{ => internal}/ql.h | 0 jemalloc/src/{ => internal}/qr.h | 0 jemalloc/src/{ => internal}/rb.h | 0 jemalloc/src/jemalloc.c | 2 +- jemalloc/src/{jemalloc.h => jemalloc.h.in} | 2 +- jemalloc/src/jemalloc_arena.c | 2 +- jemalloc/src/jemalloc_base.c | 2 +- jemalloc/src/jemalloc_chunk.c | 2 +- jemalloc/src/jemalloc_extent.c | 2 +- jemalloc/src/jemalloc_huge.c | 2 +- jemalloc/src/jemalloc_mutex.c | 2 +- jemalloc/src/jemalloc_stats.c | 2 +- jemalloc/src/jemalloc_tcache.c | 2 +- jemalloc/src/jemalloc_trace.c | 2 +- jemalloc/src/mtrgraph.c | 4 +- jemalloc/src/mtrplay.c | 4 +- 33 files changed, 161 insertions(+), 95 deletions(-) rename jemalloc/src/{ => internal}/jemalloc_arena.h (100%) rename jemalloc/src/{ => internal}/jemalloc_base.h (100%) rename jemalloc/src/{ => internal}/jemalloc_chunk.h (100%) rename jemalloc/src/{ => internal}/jemalloc_extent.h (100%) rename jemalloc/src/{ => internal}/jemalloc_huge.h (100%) rename jemalloc/src/{jemalloc_internal.h => internal/jemalloc_internal.h.in} (86%) rename jemalloc/src/{ => internal}/jemalloc_mutex.h (100%) rename jemalloc/src/{ => internal}/jemalloc_stats.h (100%) rename jemalloc/src/{ => internal}/jemalloc_tcache.h (100%) rename jemalloc/src/{ => internal}/jemalloc_trace.h (100%) create mode 100644 jemalloc/src/internal/mtrgraph_defs.h.in create mode 100644 jemalloc/src/internal/mtrplay_defs.h.in rename jemalloc/src/{ => internal}/ql.h (100%) rename jemalloc/src/{ => internal}/qr.h (100%) rename jemalloc/src/{ => internal}/rb.h (100%) rename jemalloc/src/{jemalloc.h => jemalloc.h.in} (95%) diff --git a/.gitignore b/.gitignore index 02018fe7..35acc25d 100644 --- a/.gitignore +++ b/.gitignore @@ -8,5 +8,9 @@ /jemalloc/doc/jemalloc.3 /jemalloc/lib/ /jemalloc/Makefile +/jemalloc/src/internal/jemalloc_internal\.h +/jemalloc/src/internal/mtrgraph_defs\.h +/jemalloc/src/internal/mtrplay_defs\.h +/jemalloc/src/jemalloc\.h /jemalloc/src/jemalloc_defs\.h /jemalloc/src/*.[od] diff --git a/jemalloc/INSTALL b/jemalloc/INSTALL index c24895ac..5cccb4ec 100644 --- a/jemalloc/INSTALL +++ b/jemalloc/INSTALL @@ -31,6 +31,11 @@ any of the following arguments (not a definitive list) to 'configure': becomes malloc(). This makes it possible to use jemalloc at the same time as the system allocator. +--with-install-suffix= + Append to the base name of all installed files, such that multiple + versions of jemalloc can coexist in the same installation directory. For + example, libjemalloc.so.0 becomes libjemalloc.so.0. + --enable-debug Enable assertions and validation code. This incurs a substantial performance hit, but is very useful during application development. diff --git a/jemalloc/Makefile.in b/jemalloc/Makefile.in index a0440117..0e6f9290 100644 --- a/jemalloc/Makefile.in +++ b/jemalloc/Makefile.in @@ -17,7 +17,7 @@ LIBDIR := @LIBDIR@ MANDIR := @MANDIR@ # Build parameters. -CPPFLAGS := @CPPFLAGS@ +CPPFLAGS := @CPPFLAGS@ -I@srcroot@src -I@objroot@src CFLAGS := @CFLAGS@ -fPIC -DPIC ifeq (macho, @abi@) CFLAGS += -dynamic @@ -33,17 +33,19 @@ SO := so endif REV := 0 -# List of files to be installed. +# Lists of files. BINS := @bins@ -CHDRS := @srcroot@src/jemalloc.h @objroot@src/jemalloc_defs.h +CHDRS := @objroot@src/jemalloc@install_suffix@.h \ + @objroot@src/jemalloc_defs@install_suffix@.h CSRCS := @srcroot@src/jemalloc.c @srcroot@src/jemalloc_arena.c \ @srcroot@src/jemalloc_base.c @srcroot@src/jemalloc_chunk.c \ @srcroot@src/jemalloc_extent.c @srcroot@src/jemalloc_huge.c \ @srcroot@src/jemalloc_mutex.c @srcroot@src/jemalloc_stats.c \ @srcroot@src/jemalloc_tcache.c @srcroot@src/jemalloc_trace.c -DSOS := @objroot@lib/libjemalloc.so.$(REV) @objroot@lib/libjemalloc.so \ - @objroot@lib/libjemalloc_pic.a -MAN3 := @objroot@doc/jemalloc.3 +DSOS := @objroot@lib/libjemalloc@install_suffix@.so.$(REV) \ + @objroot@lib/libjemalloc@install_suffix@.so \ + @objroot@lib/libjemalloc@install_suffix@_pic.a +MAN3 := @objroot@doc/jemalloc@install_suffix@.3 .PHONY: all dist install check clean distclean relclean @@ -62,16 +64,16 @@ all: $(DSOS) bins $(DSOS): $(CSRCS:@srcroot@%.c=@objroot@%.o) @mkdir -p $(@D) $(CC) -shared -o $@ $+ $(LDFLAGS) $(LIBS) - ln -sf libjemalloc.so.$(REV) lib/libjemalloc.so - ar crus @objroot@lib/libjemalloc_pic.a $+ + ln -sf libjemalloc@install_suffix@.so.$(REV) lib/libjemalloc@install_suffix@.so + ar crus @objroot@lib/libjemalloc@install_suffix@_pic.a $+ bins: $(BINS) -@objroot@bin/mtrgraph: @objroot@src/mtrgraph.o +@objroot@bin/mtrgraph@install_suffix@: @objroot@src/mtrgraph.o @mkdir -p $(@D) $(CC) -o $@ $< $(LDFLAGS) $(LIBS) $(GDLIBS) -@objroot@bin/%: @objroot@src/%.o +@objroot@bin/%@install_suffix@: @objroot@src/%.o @mkdir -p $(@D) $(CC) -o $@ $< $(LDFLAGS) $(LIBS) @@ -87,11 +89,10 @@ done install -m 644 $$h $(INCLUDEDIR); \ done install -d $(LIBDIR) - @for s in $(DSOS); do \ - echo "install -m 755 $$s $(LIBDIR)"; \ - install -m 755 $$s $(LIBDIR); \ -done - install -d $(MANDIR) + install -m 755 @objroot@lib/libjemalloc@install_suffix@.so.$(REV) $(LIBDIR) + ln -sf libjemalloc@install_suffix@.so.$(REV) $(LIBDIR)/libjemalloc@install_suffix@.so + install -m 755 @objroot@lib/libjemalloc@install_suffix@_pic.a $(LIBDIR) + install -d $(MANDIR)/man3 @for m in $(MAN3); do \ echo "install -m 644 $$m $(MANDIR)/man3"; \ install -m 644 $$m $(MANDIR)/man3; \ @@ -112,8 +113,8 @@ distclean: clean rm -f @objroot@config.status rm -f @objroot@cfghdrs.stamp rm -f @objroot@cfgoutputs.stamp - rm -f @cfghdrs@ - rm -f @cfgoutputs@ + rm -f @cfghdrs_out@ + rm -f @cfgoutputs_out@ relclean: distclean rm -rf @objroot@autom4te.cache @@ -133,8 +134,7 @@ ifeq (@enable_autogen@, 1) @srcroot@cfghdrs.stamp.in : @srcroot@configure.ac echo stamp > @srcroot@cfghdrs.stamp.in -@objroot@cfghdrs.stamp : $(patsubst %, %.in, @cfghdrs@) \ - @srcroot@configure +@objroot@cfghdrs.stamp : @cfghdrs_in@ @srcroot@configure ./@objroot@config.status @touch $@ @@ -144,8 +144,7 @@ ifeq (@enable_autogen@, 1) @srcroot@cfgoutputs.stamp.in : @srcroot@configure.ac echo stamp > @srcroot@cfgoutputs.stamp.in -@objroot@cfgoutputs.stamp : $(patsubst %, @srcroot@%.in, @cfgoutputs@) \ - @srcroot@configure +@objroot@cfgoutputs.stamp : @cfgoutputs_in@ @srcroot@configure ./@objroot@config.status @touch $@ diff --git a/jemalloc/configure.ac b/jemalloc/configure.ac index 07adeb13..f37c2e83 100644 --- a/jemalloc/configure.ac +++ b/jemalloc/configure.ac @@ -80,9 +80,6 @@ MANDIR=`eval echo $mandir` MANDIR=`eval echo $MANDIR` AC_SUBST([MANDIR]) -cfgoutputs="Makefile doc/jemalloc.3" -cfghdrs="src/jemalloc_defs.h" - dnl If CFLAGS isn't defined, set CFLAGS to something reasonable. Otherwise, dnl just prevent autoconf from molesting CFLAGS. CFLAGS=$CFLAGS @@ -246,20 +243,49 @@ AC_PATH_PROG([AUTOCONF], [autoconf], , [$PATH]) dnl Do not prefix public APIs by default. AC_ARG_WITH([jemalloc_prefix], [AS_HELP_STRING([--with-jemalloc-prefix=], [Prefix to prepend to all public APIs])], -if test "x$with_jemalloc_prefix" = "xno" ; then - JEMALLOC_PREFIX= -else - JEMALLOC_PREFIX="$with_jemalloc_prefix" -fi, - JEMALLOC_PREFIX= + [JEMALLOC_PREFIX="$with_jemalloc_prefix"], + [JEMALLOC_PREFIX=] ) if test "x$JEMALLOC_PREFIX" != "x" ; then AC_DEFINE([JEMALLOC_PREFIX], [ ]) - jemalloc_prefix=$JEMALLOC_PREFIX + jemalloc_prefix="$JEMALLOC_PREFIX" AC_SUBST([jemalloc_prefix]) AC_DEFINE_UNQUOTED([JEMALLOC_P(string_that_no_one_should_want_to_use_as_a_jemalloc_API_prefix)], [${JEMALLOC_PREFIX}##string_that_no_one_should_want_to_use_as_a_jemalloc_API_prefix]) fi +dnl Do not add suffix to installed files by default. +AC_ARG_WITH([install_suffix], + [AS_HELP_STRING([--with-install-suffix=], [Suffix to append to all installed files])], + [INSTALL_SUFFIX="$with_install_suffix"], + [INSTALL_SUFFIX=] +) +install_suffix="$INSTALL_SUFFIX" +AC_SUBST([install_suffix]) + +cfgoutputs_in="Makefile doc/jemalloc.3.in" +cfgoutputs_in="${cfgoutputs_in} src/jemalloc.h.in" +cfgoutputs_in="${cfgoutputs_in} src/internal/jemalloc_internal.h.in" + +cfgoutputs_out="Makefile doc/jemalloc${install_suffix}.3" +cfgoutputs_out="${cfgoutputs_out} src/jemalloc${install_suffix}.h" +cfgoutputs_out="${cfgoutputs_out} src/internal/jemalloc_internal.h" + +cfgoutputs_tup="Makefile doc/jemalloc${install_suffix}.3:doc/jemalloc.3.in" +cfgoutputs_tup="${cfgoutputs_tup} src/jemalloc${install_suffix}.h:src/jemalloc.h.in" +cfgoutputs_tup="${cfgoutputs_tup} src/internal/jemalloc_internal.h" + +cfghdrs_in="src/jemalloc_defs.h.in" +cfghdrs_in="${cfghdrs_in} src/internal/mtrgraph_defs.h.in" +cfghdrs_in="${cfghdrs_in} src/internal/mtrplay_defs.h.in" + +cfghdrs_out="src/jemalloc_defs${install_suffix}.h" +cfghdrs_out="${cfghdrs_out} src/internal/mtrgraph_defs.h" +cfghdrs_out="${cfghdrs_out} src/internal/mtrplay_defs.h" + +cfghdrs_tup="src/jemalloc_defs${install_suffix}.h:src/jemalloc_defs.h.in" +cfghdrs_tup="${cfghdrs_tup} src/internal/mtrgraph_defs.h" +cfghdrs_tup="${cfghdrs_tup} src/internal/mtrplay_defs.h" + dnl Do not compile with debugging by default. AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug], [Build debugging code])], @@ -577,7 +603,8 @@ AC_SUBST([enable_lazy_lock]) dnl ============================================================================ dnl Configure libgd for mtrgraph. -bins="${objroot}bin/jemtr2mtr ${objroot}bin/mtrplay" +bins="${objroot}bin/jemtr2mtr${install_suffix}" +bins="${bins} ${objroot}bin/mtrplay${install_suffix}" GDLIBS="" have_libgd="yes" @@ -590,7 +617,7 @@ AC_CHECK_HEADERS([gdfontg.h], , [have_libgd="no"]) AC_CHECK_LIB([gd], [gdImageCreate], [GDLIBS="-lgd"], [have_libgd="no"]) if test "x${have_libgd}" = "xyes" ; then - bins="${bins} ${objroot}bin/mtrgraph" + bins="${bins} ${objroot}bin/mtrgraph${install_suffix}" fi AC_SUBST([bins]) AC_SUBST([GDLIBS]) @@ -600,13 +627,15 @@ dnl Check for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL dnl Process .in files. -AC_SUBST([cfghdrs]) -AC_CONFIG_HEADERS([$cfghdrs cfghdrs.stamp]) +AC_SUBST([cfghdrs_in]) +AC_SUBST([cfghdrs_out]) +AC_CONFIG_HEADERS([$cfghdrs_tup cfghdrs.stamp]) dnl ============================================================================ dnl Generate outputs. -AC_CONFIG_FILES([$cfgoutputs cfgoutputs.stamp]) -AC_SUBST([cfgoutputs]) +AC_CONFIG_FILES([$cfgoutputs_tup cfgoutputs.stamp]) +AC_SUBST([cfgoutputs_in]) +AC_SUBST([cfgoutputs_out]) AC_OUTPUT dnl ============================================================================ @@ -636,6 +665,7 @@ AC_MSG_RESULT([]) AC_MSG_RESULT([bins : ${bins}]) AC_MSG_RESULT([]) AC_MSG_RESULT([JEMALLOC_PREFIX : ${JEMALLOC_PREFIX}]) +AC_MSG_RESULT([install_suffix : ${install_suffix}]) AC_MSG_RESULT([autogen : ${enable_autogen}]) AC_MSG_RESULT([debug : ${enable_debug}]) AC_MSG_RESULT([stats : ${enable_stats}]) diff --git a/jemalloc/doc/jemalloc.3.in b/jemalloc/doc/jemalloc.3.in index f55325e8..ca8deb1d 100644 --- a/jemalloc/doc/jemalloc.3.in +++ b/jemalloc/doc/jemalloc.3.in @@ -38,7 +38,7 @@ .\" @(#)malloc.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD: head/lib/libc/stdlib/malloc.3 182225 2008-08-27 02:00:53Z jasone $ .\" -.Dd January 3, 2010 +.Dd January 17, 2010 .Dt JEMALLOC 3 .Os .Sh NAME @@ -46,10 +46,10 @@ @roff_no_tcache@.Nm @jemalloc_prefix@malloc , @jemalloc_prefix@calloc , @jemalloc_prefix@posix_memalign , @jemalloc_prefix@realloc , @jemalloc_prefix@free , @jemalloc_prefix@malloc_usable_size , @jemalloc_prefix@malloc_stats_print .Nd general purpose memory allocation functions .Sh LIBRARY -.Lb libjemalloc +.Lb libjemalloc@install_suffix@ .Sh SYNOPSIS .In stdlib.h -.In jemalloc.h +.In jemalloc@install_suffix@.h .Ft void * .Fn @jemalloc_prefix@malloc "size_t size" .Ft void * diff --git a/jemalloc/src/jemalloc_arena.h b/jemalloc/src/internal/jemalloc_arena.h similarity index 100% rename from jemalloc/src/jemalloc_arena.h rename to jemalloc/src/internal/jemalloc_arena.h diff --git a/jemalloc/src/jemalloc_base.h b/jemalloc/src/internal/jemalloc_base.h similarity index 100% rename from jemalloc/src/jemalloc_base.h rename to jemalloc/src/internal/jemalloc_base.h diff --git a/jemalloc/src/jemalloc_chunk.h b/jemalloc/src/internal/jemalloc_chunk.h similarity index 100% rename from jemalloc/src/jemalloc_chunk.h rename to jemalloc/src/internal/jemalloc_chunk.h diff --git a/jemalloc/src/jemalloc_extent.h b/jemalloc/src/internal/jemalloc_extent.h similarity index 100% rename from jemalloc/src/jemalloc_extent.h rename to jemalloc/src/internal/jemalloc_extent.h diff --git a/jemalloc/src/jemalloc_huge.h b/jemalloc/src/internal/jemalloc_huge.h similarity index 100% rename from jemalloc/src/jemalloc_huge.h rename to jemalloc/src/internal/jemalloc_huge.h diff --git a/jemalloc/src/jemalloc_internal.h b/jemalloc/src/internal/jemalloc_internal.h.in similarity index 86% rename from jemalloc/src/jemalloc_internal.h rename to jemalloc/src/internal/jemalloc_internal.h.in index 5be40da7..139c0e7b 100644 --- a/jemalloc/src/jemalloc_internal.h +++ b/jemalloc/src/internal/jemalloc_internal.h.in @@ -24,16 +24,16 @@ #include #define JEMALLOC_MANGLE -#include "jemalloc.h" +#include "../jemalloc@install_suffix@.h" #ifdef JEMALLOC_LAZY_LOCK #include #endif -#include "rb.h" +#include "internal/rb.h" #if (defined(JEMALLOC_TCACHE) && defined(JEMALLOC_STATS)) -#include "qr.h" -#include "ql.h" +#include "internal/qr.h" +#include "internal/ql.h" #endif extern void (*JEMALLOC_P(malloc_message))(const char *p1, const char *p2, @@ -168,29 +168,29 @@ extern void (*JEMALLOC_P(malloc_message))(const char *p1, const char *p2, #define PAGE_CEILING(s) \ (((s) + PAGE_MASK) & ~PAGE_MASK) -#include "jemalloc_stats.h" -#include "jemalloc_mutex.h" -#include "jemalloc_extent.h" -#include "jemalloc_arena.h" -#include "jemalloc_base.h" -#include "jemalloc_chunk.h" -#include "jemalloc_huge.h" -#include "jemalloc_tcache.h" -#include "jemalloc_trace.h" +#include "internal/jemalloc_stats.h" +#include "internal/jemalloc_mutex.h" +#include "internal/jemalloc_extent.h" +#include "internal/jemalloc_arena.h" +#include "internal/jemalloc_base.h" +#include "internal/jemalloc_chunk.h" +#include "internal/jemalloc_huge.h" +#include "internal/jemalloc_tcache.h" +#include "internal/jemalloc_trace.h" #undef JEMALLOC_H_TYPES /******************************************************************************/ #define JEMALLOC_H_STRUCTS -#include "jemalloc_stats.h" -#include "jemalloc_mutex.h" -#include "jemalloc_extent.h" -#include "jemalloc_arena.h" -#include "jemalloc_base.h" -#include "jemalloc_chunk.h" -#include "jemalloc_huge.h" -#include "jemalloc_tcache.h" -#include "jemalloc_trace.h" +#include "internal/jemalloc_stats.h" +#include "internal/jemalloc_mutex.h" +#include "internal/jemalloc_extent.h" +#include "internal/jemalloc_arena.h" +#include "internal/jemalloc_base.h" +#include "internal/jemalloc_chunk.h" +#include "internal/jemalloc_huge.h" +#include "internal/jemalloc_tcache.h" +#include "internal/jemalloc_trace.h" #undef JEMALLOC_H_STRUCTS /******************************************************************************/ @@ -238,26 +238,26 @@ arena_t *arenas_extend(unsigned ind); arena_t *choose_arena_hard(void); #endif -#include "jemalloc_stats.h" -#include "jemalloc_mutex.h" -#include "jemalloc_extent.h" -#include "jemalloc_arena.h" -#include "jemalloc_base.h" -#include "jemalloc_chunk.h" -#include "jemalloc_huge.h" -#include "jemalloc_tcache.h" -#include "jemalloc_trace.h" +#include "internal/jemalloc_stats.h" +#include "internal/jemalloc_mutex.h" +#include "internal/jemalloc_extent.h" +#include "internal/jemalloc_arena.h" +#include "internal/jemalloc_base.h" +#include "internal/jemalloc_chunk.h" +#include "internal/jemalloc_huge.h" +#include "internal/jemalloc_tcache.h" +#include "internal/jemalloc_trace.h" #undef JEMALLOC_H_EXTERNS /******************************************************************************/ #define JEMALLOC_H_INLINES -#include "jemalloc_stats.h" -#include "jemalloc_mutex.h" -#include "jemalloc_extent.h" -#include "jemalloc_base.h" -#include "jemalloc_chunk.h" -#include "jemalloc_huge.h" +#include "internal/jemalloc_stats.h" +#include "internal/jemalloc_mutex.h" +#include "internal/jemalloc_extent.h" +#include "internal/jemalloc_base.h" +#include "internal/jemalloc_chunk.h" +#include "internal/jemalloc_huge.h" #ifndef JEMALLOC_ENABLE_INLINE void malloc_write4(const char *p1, const char *p2, const char *p3, @@ -346,9 +346,9 @@ choose_arena(void) } #endif -#include "jemalloc_tcache.h" -#include "jemalloc_arena.h" -#include "jemalloc_trace.h" +#include "internal/jemalloc_tcache.h" +#include "internal/jemalloc_arena.h" +#include "internal/jemalloc_trace.h" #ifndef JEMALLOC_ENABLE_INLINE void *imalloc(size_t size); diff --git a/jemalloc/src/jemalloc_mutex.h b/jemalloc/src/internal/jemalloc_mutex.h similarity index 100% rename from jemalloc/src/jemalloc_mutex.h rename to jemalloc/src/internal/jemalloc_mutex.h diff --git a/jemalloc/src/jemalloc_stats.h b/jemalloc/src/internal/jemalloc_stats.h similarity index 100% rename from jemalloc/src/jemalloc_stats.h rename to jemalloc/src/internal/jemalloc_stats.h diff --git a/jemalloc/src/jemalloc_tcache.h b/jemalloc/src/internal/jemalloc_tcache.h similarity index 100% rename from jemalloc/src/jemalloc_tcache.h rename to jemalloc/src/internal/jemalloc_tcache.h diff --git a/jemalloc/src/jemalloc_trace.h b/jemalloc/src/internal/jemalloc_trace.h similarity index 100% rename from jemalloc/src/jemalloc_trace.h rename to jemalloc/src/internal/jemalloc_trace.h diff --git a/jemalloc/src/internal/mtrgraph_defs.h.in b/jemalloc/src/internal/mtrgraph_defs.h.in new file mode 100644 index 00000000..7a81e3c7 --- /dev/null +++ b/jemalloc/src/internal/mtrgraph_defs.h.in @@ -0,0 +1,14 @@ +#ifndef MTRGRAPH_DEFS_H_ +#define MTRGRAPH_DEFS_H_ + +/* Defined if __attribute__((...)) syntax is supported. */ +#undef JEMALLOC_HAVE_ATTR +#ifdef JEMALLOC_HAVE_ATTR +# define JEMALLOC_ATTR(s) __attribute__((s)) +#else +# define JEMALLOC_ATTR(s) +#endif + +#undef JEMALLOC_DEBUG + +#endif /* MTRGRAPH_DEFS_H_ */ diff --git a/jemalloc/src/internal/mtrplay_defs.h.in b/jemalloc/src/internal/mtrplay_defs.h.in new file mode 100644 index 00000000..8b62625f --- /dev/null +++ b/jemalloc/src/internal/mtrplay_defs.h.in @@ -0,0 +1,14 @@ +#ifndef MTRPLAY_DEFS_H_ +#define MTRPLAY_DEFS_H_ + +/* Defined if __attribute__((...)) syntax is supported. */ +#undef JEMALLOC_HAVE_ATTR +#ifdef JEMALLOC_HAVE_ATTR +# define JEMALLOC_ATTR(s) __attribute__((s)) +#else +# define JEMALLOC_ATTR(s) +#endif + +#undef JEMALLOC_DEBUG + +#endif /* MTRPLAY_DEFS_H_ */ diff --git a/jemalloc/src/ql.h b/jemalloc/src/internal/ql.h similarity index 100% rename from jemalloc/src/ql.h rename to jemalloc/src/internal/ql.h diff --git a/jemalloc/src/qr.h b/jemalloc/src/internal/qr.h similarity index 100% rename from jemalloc/src/qr.h rename to jemalloc/src/internal/qr.h diff --git a/jemalloc/src/rb.h b/jemalloc/src/internal/rb.h similarity index 100% rename from jemalloc/src/rb.h rename to jemalloc/src/internal/rb.h diff --git a/jemalloc/src/jemalloc.c b/jemalloc/src/jemalloc.c index 8a0d97a3..7a9f906f 100644 --- a/jemalloc/src/jemalloc.c +++ b/jemalloc/src/jemalloc.c @@ -90,7 +90,7 @@ */ #define JEMALLOC_C_ -#include "jemalloc_internal.h" +#include "internal/jemalloc_internal.h" /******************************************************************************/ /* Data. */ diff --git a/jemalloc/src/jemalloc.h b/jemalloc/src/jemalloc.h.in similarity index 95% rename from jemalloc/src/jemalloc.h rename to jemalloc/src/jemalloc.h.in index 71c46b65..f2a89f59 100644 --- a/jemalloc/src/jemalloc.h +++ b/jemalloc/src/jemalloc.h.in @@ -4,7 +4,7 @@ extern "C" { #endif -#include "jemalloc_defs.h" +#include "jemalloc_defs@install_suffix@.h" #ifndef JEMALLOC_P # define JEMALLOC_P(s) s #endif diff --git a/jemalloc/src/jemalloc_arena.c b/jemalloc/src/jemalloc_arena.c index 5c8ea238..0f031c15 100644 --- a/jemalloc/src/jemalloc_arena.c +++ b/jemalloc/src/jemalloc_arena.c @@ -1,5 +1,5 @@ #define JEMALLOC_ARENA_C_ -#include "jemalloc_internal.h" +#include "internal/jemalloc_internal.h" /******************************************************************************/ /* Data. */ diff --git a/jemalloc/src/jemalloc_base.c b/jemalloc/src/jemalloc_base.c index 83499f6c..af83cec5 100644 --- a/jemalloc/src/jemalloc_base.c +++ b/jemalloc/src/jemalloc_base.c @@ -1,5 +1,5 @@ #define JEMALLOC_BASE_C_ -#include "jemalloc_internal.h" +#include "internal/jemalloc_internal.h" #ifdef JEMALLOC_STATS size_t base_mapped; diff --git a/jemalloc/src/jemalloc_chunk.c b/jemalloc/src/jemalloc_chunk.c index caa941af..9cd0c211 100644 --- a/jemalloc/src/jemalloc_chunk.c +++ b/jemalloc/src/jemalloc_chunk.c @@ -1,5 +1,5 @@ #define JEMALLOC_CHUNK_C_ -#include "jemalloc_internal.h" +#include "internal/jemalloc_internal.h" /******************************************************************************/ /* Data. */ diff --git a/jemalloc/src/jemalloc_extent.c b/jemalloc/src/jemalloc_extent.c index 8f287f7b..cbe7c4b0 100644 --- a/jemalloc/src/jemalloc_extent.c +++ b/jemalloc/src/jemalloc_extent.c @@ -1,5 +1,5 @@ #define JEMALLOC_EXTENT_C_ -#include "jemalloc_internal.h" +#include "internal/jemalloc_internal.h" /******************************************************************************/ diff --git a/jemalloc/src/jemalloc_huge.c b/jemalloc/src/jemalloc_huge.c index 6d71f654..b325927e 100644 --- a/jemalloc/src/jemalloc_huge.c +++ b/jemalloc/src/jemalloc_huge.c @@ -1,5 +1,5 @@ #define JEMALLOC_HUGE_C_ -#include "jemalloc_internal.h" +#include "internal/jemalloc_internal.h" /******************************************************************************/ /* Data. */ diff --git a/jemalloc/src/jemalloc_mutex.c b/jemalloc/src/jemalloc_mutex.c index 26292e52..5e3cab3c 100644 --- a/jemalloc/src/jemalloc_mutex.c +++ b/jemalloc/src/jemalloc_mutex.c @@ -1,5 +1,5 @@ #define JEMALLOC_MUTEX_C_ -#include "jemalloc_internal.h" +#include "internal/jemalloc_internal.h" /******************************************************************************/ /* Data. */ diff --git a/jemalloc/src/jemalloc_stats.c b/jemalloc/src/jemalloc_stats.c index 2db7740d..e39bcfe7 100644 --- a/jemalloc/src/jemalloc_stats.c +++ b/jemalloc/src/jemalloc_stats.c @@ -1,5 +1,5 @@ #define JEMALLOC_STATS_C_ -#include "jemalloc_internal.h" +#include "internal/jemalloc_internal.h" /******************************************************************************/ /* Data. */ diff --git a/jemalloc/src/jemalloc_tcache.c b/jemalloc/src/jemalloc_tcache.c index 1257703c..fe572eb4 100644 --- a/jemalloc/src/jemalloc_tcache.c +++ b/jemalloc/src/jemalloc_tcache.c @@ -1,5 +1,5 @@ #define JEMALLOC_TCACHE_C_ -#include "jemalloc_internal.h" +#include "internal/jemalloc_internal.h" #ifdef JEMALLOC_TCACHE /******************************************************************************/ /* Data. */ diff --git a/jemalloc/src/jemalloc_trace.c b/jemalloc/src/jemalloc_trace.c index 81630190..657a0968 100644 --- a/jemalloc/src/jemalloc_trace.c +++ b/jemalloc/src/jemalloc_trace.c @@ -1,5 +1,5 @@ #define JEMALLOC_TRACE_C_ -#include "jemalloc_internal.h" +#include "internal/jemalloc_internal.h" #ifdef JEMALLOC_TRACE /******************************************************************************/ /* Data. */ diff --git a/jemalloc/src/mtrgraph.c b/jemalloc/src/mtrgraph.c index cc17be29..c5f9dd31 100644 --- a/jemalloc/src/mtrgraph.c +++ b/jemalloc/src/mtrgraph.c @@ -15,12 +15,12 @@ #include #include -#include "jemalloc.h" +#include "internal/mtrgraph_defs.h" #ifndef JEMALLOC_DEBUG # define NDEBUG #endif #include -#include "rb.h" +#include "internal/rb.h" typedef struct { diff --git a/jemalloc/src/mtrplay.c b/jemalloc/src/mtrplay.c index 776ca261..134930f5 100644 --- a/jemalloc/src/mtrplay.c +++ b/jemalloc/src/mtrplay.c @@ -16,12 +16,12 @@ #include #include -#include "jemalloc_defs.h" +#include "internal/mtrplay_defs.h" #ifndef JEMALLOC_DEBUG # define NDEBUG #endif #include -#include "rb.h" +#include "internal/rb.h" typedef struct record_s record_t; struct record_s {