From 7467954d017e772c9e02edaeb61ea4d39751b22f Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Fri, 17 Jul 2020 21:30:40 +0800 Subject: [PATCH 1/5] update jemalloc to 5.2.1 Signed-off-by: Jay Lee --- jemalloc-sys/configure/VERSION | 2 +- jemalloc-sys/configure/configure | 884 ++++++++++++++++++++++--------- jemalloc-sys/jemalloc | 2 +- 3 files changed, 628 insertions(+), 260 deletions(-) diff --git a/jemalloc-sys/configure/VERSION b/jemalloc-sys/configure/VERSION index a3c3033a5a..428ded8c07 100644 --- a/jemalloc-sys/configure/VERSION +++ b/jemalloc-sys/configure/VERSION @@ -1 +1 @@ -5.1.0-0-g61efbda7098de6fe64c362d309824864308c36d4 +5.2.1-0-gea6b3e973b477b8061e0076bb257dbd7f3faa756 diff --git a/jemalloc-sys/configure/configure b/jemalloc-sys/configure/configure index 4d96211f39..403f5ba450 100755 --- a/jemalloc-sys/configure/configure +++ b/jemalloc-sys/configure/configure @@ -629,18 +629,16 @@ enable_initial_exec_tls enable_zone_allocator enable_tls enable_lazy_lock -jemalloc_version_gid -jemalloc_version_nrev -jemalloc_version_bugfix -jemalloc_version_minor -jemalloc_version_major -jemalloc_version +libdl +enable_opt_safety_checks +enable_readlinkat enable_log enable_cache_oblivious enable_xmalloc enable_utrace enable_fill enable_prof +enable_experimental_smallocx enable_stats enable_debug je_ @@ -648,6 +646,9 @@ install_suffix private_namespace JEMALLOC_CPREFIX JEMALLOC_PREFIX +enable_static +enable_shared +enable_doc AUTOCONF LD RANLIB @@ -679,6 +680,12 @@ so LD_PRELOAD_VAR RPATH abi +jemalloc_version_gid +jemalloc_version_nrev +jemalloc_version_bugfix +jemalloc_version_minor +jemalloc_version_major +jemalloc_version AWK NM AR @@ -744,7 +751,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -770,8 +776,12 @@ enable_option_checking with_xslroot enable_cxx with_lg_vaddr +with_version with_rpath enable_autogen +enable_doc +enable_shared +enable_static with_mangling with_jemalloc_prefix with_export @@ -780,6 +790,7 @@ with_install_suffix with_malloc_conf enable_debug enable_stats +enable_experimental_smallocx enable_prof enable_prof_libunwind with_static_libunwind @@ -790,11 +801,12 @@ enable_utrace enable_xmalloc enable_cache_oblivious enable_log +enable_readlinkat +enable_opt_safety_checks with_lg_quantum with_lg_page with_lg_hugepage -with_lg_page_sizes -with_version +enable_libdl enable_syscall enable_lazy_lock enable_zone_allocator @@ -850,7 +862,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1103,15 +1114,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1249,7 +1251,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1402,7 +1404,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1436,8 +1437,13 @@ Optional Features: --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-cxx Disable C++ integration --enable-autogen Automatically regenerate configure output + --enable-documentation Build documentation + --enable-shared Build shared libaries + --enable-static Build static libaries --enable-debug Build debugging code --disable-stats Disable statistics calculation/reporting + --enable-experimental-smallocx + Enable experimental smallocx API --enable-prof Enable allocation profiling --enable-prof-libunwind Use libunwind for backtracing --disable-prof-libgcc Do not use libgcc for backtracing @@ -1449,6 +1455,11 @@ Optional Features: Disable support for cache-oblivious allocation alignment --enable-log Support debug logging + --enable-readlinkat Use readlinkat over readlink + --enable-opt-safety-checks + Perform certain low-overhead checks, even in opt + mode + --disable-libdl Do not use libdl --disable-syscall Disable use of syscall(2) --enable-lazy-lock Enable lazy locking (only lock when multi-threaded) --disable-zone-allocator @@ -1462,6 +1473,8 @@ Optional Packages: --with-xslroot= XSL stylesheet root path --with-lg-vaddr= Number of significant virtual address bits + --with-version=..--g + Version string --with-rpath= Colon-separated rpath (ELF systems only) --with-mangling= Mangle symbols in --with-jemalloc-prefix= @@ -1482,10 +1495,6 @@ Optional Packages: Base 2 log of system page size --with-lg-hugepage= Base 2 log of system huge page size - --with-lg-page-sizes= - Base 2 logs of system page sizes to support - --with-version=..--g - Version string Some influential environment variables: CC C compiler command @@ -2711,6 +2720,9 @@ else fi +if test "x$XSLTPROC" = "xfalse" ; then + XSLROOT="" +fi CFLAGS=$CFLAGS @@ -3778,6 +3790,57 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wextra" >&5 +$as_echo_n "checking whether compiler supports -Wextra... " >&6; } +T_CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS}" +T_APPEND_V=-Wextra + if test "x${CONFIGURE_CFLAGS}" = "x" -o "x${T_APPEND_V}" = "x" ; then + CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS}${T_APPEND_V}" +else + CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS} ${T_APPEND_V}" +fi + + +if test "x${CONFIGURE_CFLAGS}" = "x" -o "x${SPECIFIED_CFLAGS}" = "x" ; then + CFLAGS="${CONFIGURE_CFLAGS}${SPECIFIED_CFLAGS}" +else + CFLAGS="${CONFIGURE_CFLAGS} ${SPECIFIED_CFLAGS}" +fi + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + je_cv_cflags_added=-Wextra + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + je_cv_cflags_added= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CONFIGURE_CFLAGS="${T_CONFIGURE_CFLAGS}" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test "x${CONFIGURE_CFLAGS}" = "x" -o "x${SPECIFIED_CFLAGS}" = "x" ; then + CFLAGS="${CONFIGURE_CFLAGS}${SPECIFIED_CFLAGS}" +else + CFLAGS="${CONFIGURE_CFLAGS} ${SPECIFIED_CFLAGS}" +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wshorten-64-to-32" >&5 $as_echo_n "checking whether compiler supports -Wshorten-64-to-32... " >&6; } T_CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS}" @@ -5945,6 +6008,69 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wextra" >&5 +$as_echo_n "checking whether compiler supports -Wextra... " >&6; } +T_CONFIGURE_CXXFLAGS="${CONFIGURE_CXXFLAGS}" +T_APPEND_V=-Wextra + if test "x${CONFIGURE_CXXFLAGS}" = "x" -o "x${T_APPEND_V}" = "x" ; then + CONFIGURE_CXXFLAGS="${CONFIGURE_CXXFLAGS}${T_APPEND_V}" +else + CONFIGURE_CXXFLAGS="${CONFIGURE_CXXFLAGS} ${T_APPEND_V}" +fi + + +if test "x${CONFIGURE_CXXFLAGS}" = "x" -o "x${SPECIFIED_CXXFLAGS}" = "x" ; then + CXXFLAGS="${CONFIGURE_CXXFLAGS}${SPECIFIED_CXXFLAGS}" +else + CXXFLAGS="${CONFIGURE_CXXFLAGS} ${SPECIFIED_CXXFLAGS}" +fi + +ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + je_cv_cxxflags_added=-Wextra + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + je_cv_cxxflags_added= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CONFIGURE_CXXFLAGS="${T_CONFIGURE_CXXFLAGS}" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +if test "x${CONFIGURE_CXXFLAGS}" = "x" -o "x${SPECIFIED_CXXFLAGS}" = "x" ; then + CXXFLAGS="${CONFIGURE_CXXFLAGS}${SPECIFIED_CXXFLAGS}" +else + CXXFLAGS="${CONFIGURE_CXXFLAGS} ${SPECIFIED_CXXFLAGS}" +fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -g3" >&5 $as_echo_n "checking whether compiler supports -g3... " >&6; } T_CONFIGURE_CXXFLAGS="${CONFIGURE_CXXFLAGS}" @@ -7350,6 +7476,63 @@ fi done + + +# Check whether --with-version was given. +if test "${with_version+set}" = set; then : + withval=$with_version; + echo "${with_version}" | grep '^[0-9]\+\.[0-9]\+\.[0-9]\+-[0-9]\+-g[0-9a-f]\+$' 2>&1 1>/dev/null + if test $? -eq 0 ; then + echo "$with_version" > "${objroot}VERSION" + else + echo "${with_version}" | grep '^VERSION$' 2>&1 1>/dev/null + if test $? -ne 0 ; then + as_fn_error $? "${with_version} does not match ..--g or VERSION" "$LINENO" 5 + fi + fi + +else + + if test "x`test ! \"${srcroot}\" && cd \"${srcroot}\"; git rev-parse --is-inside-work-tree 2>/dev/null`" = "xtrue" ; then + for pattern in '[0-9].[0-9].[0-9]' '[0-9].[0-9].[0-9][0-9]' \ + '[0-9].[0-9][0-9].[0-9]' '[0-9].[0-9][0-9].[0-9][0-9]' \ + '[0-9][0-9].[0-9].[0-9]' '[0-9][0-9].[0-9].[0-9][0-9]' \ + '[0-9][0-9].[0-9][0-9].[0-9]' \ + '[0-9][0-9].[0-9][0-9].[0-9][0-9]'; do + (test ! "${srcroot}" && cd "${srcroot}"; git describe --long --abbrev=40 --match="${pattern}") > "${objroot}VERSION.tmp" 2>/dev/null + if test $? -eq 0 ; then + mv "${objroot}VERSION.tmp" "${objroot}VERSION" + break + fi + done + fi + rm -f "${objroot}VERSION.tmp" + +fi + + +if test ! -e "${objroot}VERSION" ; then + if test ! -e "${srcroot}VERSION" ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: Missing VERSION file, and unable to generate it; creating bogus VERSION" >&5 +$as_echo "Missing VERSION file, and unable to generate it; creating bogus VERSION" >&6; } + echo "0.0.0-0-g0000000000000000000000000000000000000000" > "${objroot}VERSION" + else + cp ${srcroot}VERSION ${objroot}VERSION + fi +fi +jemalloc_version=`cat "${objroot}VERSION"` +jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print $1}'` +jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print $2}'` +jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print $3}'` +jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print $4}'` +jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print $5}'` + + + + + + + default_retain="0" maps_coalesce="1" DUMP_SYMS="${NM} -a" @@ -7539,6 +7722,9 @@ fi libprefix="" SOREV="${so}" PIC_CFLAGS="" + if test "${LG_SIZEOF_PTR}" = "3"; then + default_retain="1" + fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Unsupported operating system: ${host}" >&5 @@ -8406,37 +8592,182 @@ if test "x${je_cv_format_printf}" = "xyes" ; then fi +SAVED_CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS}" -# Check whether --with-rpath was given. -if test "${with_rpath+set}" = set; then : - withval=$with_rpath; if test "x$with_rpath" = "xno" ; then - RPATH_EXTRA= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Werror" >&5 +$as_echo_n "checking whether compiler supports -Werror... " >&6; } +T_CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS}" +T_APPEND_V=-Werror + if test "x${CONFIGURE_CFLAGS}" = "x" -o "x${T_APPEND_V}" = "x" ; then + CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS}${T_APPEND_V}" else - RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`" + CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS} ${T_APPEND_V}" fi -else - RPATH_EXTRA= + +if test "x${CONFIGURE_CFLAGS}" = "x" -o "x${SPECIFIED_CFLAGS}" = "x" ; then + CFLAGS="${CONFIGURE_CFLAGS}${SPECIFIED_CFLAGS}" +else + CFLAGS="${CONFIGURE_CFLAGS} ${SPECIFIED_CFLAGS}" fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ -# Check whether --enable-autogen was given. -if test "${enable_autogen+set}" = set; then : - enableval=$enable_autogen; if test "x$enable_autogen" = "xno" ; then - enable_autogen="0" + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + je_cv_cflags_added=-Werror + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } else - enable_autogen="1" -fi + je_cv_cflags_added= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CONFIGURE_CFLAGS="${T_CONFIGURE_CFLAGS}" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test "x${CONFIGURE_CFLAGS}" = "x" -o "x${SPECIFIED_CFLAGS}" = "x" ; then + CFLAGS="${CONFIGURE_CFLAGS}${SPECIFIED_CFLAGS}" else - enable_autogen="0" + CFLAGS="${CONFIGURE_CFLAGS} ${SPECIFIED_CFLAGS}" +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -herror_on_warning" >&5 +$as_echo_n "checking whether compiler supports -herror_on_warning... " >&6; } +T_CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS}" +T_APPEND_V=-herror_on_warning + if test "x${CONFIGURE_CFLAGS}" = "x" -o "x${T_APPEND_V}" = "x" ; then + CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS}${T_APPEND_V}" +else + CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS} ${T_APPEND_V}" fi +if test "x${CONFIGURE_CFLAGS}" = "x" -o "x${SPECIFIED_CFLAGS}" = "x" ; then + CFLAGS="${CONFIGURE_CFLAGS}${SPECIFIED_CFLAGS}" +else + CFLAGS="${CONFIGURE_CFLAGS} ${SPECIFIED_CFLAGS}" +fi -# Find a good install program. We prefer a C program (faster), +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + je_cv_cflags_added=-herror_on_warning + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + je_cv_cflags_added= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + CONFIGURE_CFLAGS="${T_CONFIGURE_CFLAGS}" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if test "x${CONFIGURE_CFLAGS}" = "x" -o "x${SPECIFIED_CFLAGS}" = "x" ; then + CFLAGS="${CONFIGURE_CFLAGS}${SPECIFIED_CFLAGS}" +else + CFLAGS="${CONFIGURE_CFLAGS} ${SPECIFIED_CFLAGS}" +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether format(printf, ...) attribute is compilable" >&5 +$as_echo_n "checking whether format(printf, ...) attribute is compilable... " >&6; } +if ${je_cv_format_arg+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +const char * __attribute__((__format_arg__(1))) foo(const char *format); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + je_cv_format_arg=yes +else + je_cv_format_arg=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_format_arg" >&5 +$as_echo "$je_cv_format_arg" >&6; } + +CONFIGURE_CFLAGS="${SAVED_CONFIGURE_CFLAGS}" +if test "x${CONFIGURE_CFLAGS}" = "x" -o "x${SPECIFIED_CFLAGS}" = "x" ; then + CFLAGS="${CONFIGURE_CFLAGS}${SPECIFIED_CFLAGS}" +else + CFLAGS="${CONFIGURE_CFLAGS} ${SPECIFIED_CFLAGS}" +fi + + +if test "x${je_cv_format_arg}" = "xyes" ; then + $as_echo "#define JEMALLOC_HAVE_ATTR_FORMAT_ARG " >>confdefs.h + +fi + + +# Check whether --with-rpath was given. +if test "${with_rpath+set}" = set; then : + withval=$with_rpath; if test "x$with_rpath" = "xno" ; then + RPATH_EXTRA= +else + RPATH_EXTRA="`echo $with_rpath | tr \":\" \" \"`" +fi +else + RPATH_EXTRA= + +fi + + + +# Check whether --enable-autogen was given. +if test "${enable_autogen+set}" = set; then : + enableval=$enable_autogen; if test "x$enable_autogen" = "xno" ; then + enable_autogen="0" +else + enable_autogen="1" +fi + +else + enable_autogen="0" + +fi + + + +# Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -8704,6 +9035,55 @@ fi +# Check whether --enable-doc was given. +if test "${enable_doc+set}" = set; then : + enableval=$enable_doc; if test "x$enable_doc" = "xno" ; then + enable_doc="0" +else + enable_doc="1" +fi + +else + enable_doc="1" + +fi + + + +# Check whether --enable-shared was given. +if test "${enable_shared+set}" = set; then : + enableval=$enable_shared; if test "x$enable_shared" = "xno" ; then + enable_shared="0" +else + enable_shared="1" +fi + +else + enable_shared="1" + +fi + + + +# Check whether --enable-static was given. +if test "${enable_static+set}" = set; then : + enableval=$enable_static; if test "x$enable_static" = "xno" ; then + enable_static="0" +else + enable_static="1" +fi + +else + enable_static="1" + +fi + + + +if test "$enable_shared$enable_static" = "00" ; then + as_fn_error $? "Please enable one of shared or static builds" "$LINENO" 5 +fi + # Check whether --with-mangling was given. if test "${with_mangling+set}" = set; then : @@ -8754,7 +9134,7 @@ fi fi -public_syms="aligned_alloc calloc dallocx free mallctl mallctlbymib mallctlnametomib malloc malloc_conf malloc_message malloc_stats_print malloc_usable_size mallocx nallocx posix_memalign rallocx realloc sallocx sdallocx xallocx" +public_syms="aligned_alloc calloc dallocx free mallctl mallctlbymib mallctlnametomib malloc malloc_conf malloc_message malloc_stats_print malloc_usable_size mallocx smallocx_${jemalloc_version_gid} nallocx posix_memalign rallocx realloc sallocx sdallocx xallocx" ac_fn_c_check_func "$LINENO" "memalign" "ac_cv_func_memalign" if test "x$ac_cv_func_memalign" = xyes; then : $as_echo "#define JEMALLOC_OVERRIDE_MEMALIGN " >>confdefs.h @@ -8919,7 +9299,6 @@ cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/private_symbols.sh" cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/private_namespace.sh" cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/public_namespace.sh" cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/public_unnamespace.sh" -cfghdrs_in="${cfghdrs_in} include/jemalloc/internal/size_classes.sh" cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc_rename.sh" cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc_mangle.sh" cfghdrs_in="${cfghdrs_in} include/jemalloc/jemalloc.sh" @@ -8932,7 +9311,6 @@ cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/private_symbols_jet.awk" cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_symbols.txt" cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_namespace.h" cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/public_unnamespace.h" -cfghdrs_out="${cfghdrs_out} include/jemalloc/internal/size_classes.h" cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_protos_jet.h" cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_rename.h" cfghdrs_out="${cfghdrs_out} include/jemalloc/jemalloc_mangle.h" @@ -8944,6 +9322,7 @@ cfghdrs_tup="include/jemalloc/jemalloc_defs.h:include/jemalloc/jemalloc_defs.h.i cfghdrs_tup="${cfghdrs_tup} include/jemalloc/internal/jemalloc_internal_defs.h:include/jemalloc/internal/jemalloc_internal_defs.h.in" cfghdrs_tup="${cfghdrs_tup} test/include/test/jemalloc_test_defs.h:test/include/test/jemalloc_test_defs.h.in" + # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; if test "x$enable_debug" = "xno" ; then @@ -9386,6 +9765,25 @@ if test "x$enable_stats" = "x1" ; then fi +# Check whether --enable-experimental_smallocx was given. +if test "${enable_experimental_smallocx+set}" = set; then : + enableval=$enable_experimental_smallocx; if test "x$enable_experimental_smallocx" = "xno" ; then +enable_experimental_smallocx="0" +else +enable_experimental_smallocx="1" +fi + +else + enable_experimental_smallocx="0" + +fi + +if test "x$enable_experimental_smallocx" = "x1" ; then + $as_echo "#define JEMALLOC_EXPERIMENTAL_SMALLOCX_API 1" >>confdefs.h + +fi + + # Check whether --enable-prof was given. if test "${enable_prof+set}" = set; then : enableval=$enable_prof; if test "x$enable_prof" = "xno" ; then @@ -9868,6 +10266,43 @@ if test "x$enable_log" = "x1" ; then fi +# Check whether --enable-readlinkat was given. +if test "${enable_readlinkat+set}" = set; then : + enableval=$enable_readlinkat; if test "x$enable_readlinkat" = "xno" ; then + enable_readlinkat="0" +else + enable_readlinkat="1" +fi + +else + enable_readlinkat="0" + +fi + +if test "x$enable_readlinkat" = "x1" ; then + $as_echo "#define JEMALLOC_READLINKAT " >>confdefs.h + +fi + + +# Check whether --enable-opt-safety-checks was given. +if test "${enable_opt_safety_checks+set}" = set; then : + enableval=$enable_opt_safety_checks; if test "x$enable_opt_safety_checks" = "xno" ; then + enable_opt_safety_checks="0" +else + enable_opt_safety_checks="1" +fi + +else + enable_opt_safety_checks="0" + +fi + +if test "x$enable_opt_safety_checks" = "x1" ; then + $as_echo "#define JEMALLOC_OPT_SAFETY_CHECKS " >>confdefs.h + +fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program using __builtin_unreachable is compilable" >&5 @@ -10008,6 +10443,50 @@ $as_echo "$je_cv_function_ffsl" >&6; } fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program using __builtin_popcountl is compilable" >&5 +$as_echo_n "checking whether a program using __builtin_popcountl is compilable... " >&6; } +if ${je_cv_gcc_builtin_popcountl+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#include + +int +main () +{ + + { + int rv = __builtin_popcountl(0x08); + printf("%d\n", rv); + } + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + je_cv_gcc_builtin_popcountl=yes +else + je_cv_gcc_builtin_popcountl=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_gcc_builtin_popcountl" >&5 +$as_echo "$je_cv_gcc_builtin_popcountl" >&6; } + +if test "x${je_cv_gcc_builtin_popcountl}" = "xyes" ; then + $as_echo "#define JEMALLOC_INTERNAL_POPCOUNT __builtin_popcount" >>confdefs.h + + $as_echo "#define JEMALLOC_INTERNAL_POPCOUNTL __builtin_popcountl" >>confdefs.h + +fi + + # Check whether --with-lg_quantum was given. if test "${with_lg_quantum+set}" = set; then : withval=$with_lg_quantum; LG_QUANTA="$with_lg_quantum" @@ -10142,71 +10621,20 @@ cat >>confdefs.h <<_ACEOF _ACEOF - -# Check whether --with-lg_page_sizes was given. -if test "${with_lg_page_sizes+set}" = set; then : - withval=$with_lg_page_sizes; LG_PAGE_SIZES="$with_lg_page_sizes" +# Check whether --enable-libdl was given. +if test "${enable_libdl+set}" = set; then : + enableval=$enable_libdl; if test "x$enable_libdl" = "xno" ; then + enable_libdl="0" else - LG_PAGE_SIZES="$LG_PAGE" + enable_libdl="1" fi - - - -# Check whether --with-version was given. -if test "${with_version+set}" = set; then : - withval=$with_version; - echo "${with_version}" | grep '^[0-9]\+\.[0-9]\+\.[0-9]\+-[0-9]\+-g[0-9a-f]\+$' 2>&1 1>/dev/null - if test $? -eq 0 ; then - echo "$with_version" > "${objroot}VERSION" - else - echo "${with_version}" | grep '^VERSION$' 2>&1 1>/dev/null - if test $? -ne 0 ; then - as_fn_error $? "${with_version} does not match ..--g or VERSION" "$LINENO" 5 - fi - fi - else - - if test "x`test ! \"${srcroot}\" && cd \"${srcroot}\"; git rev-parse --is-inside-work-tree 2>/dev/null`" = "xtrue" ; then - for pattern in '[0-9].[0-9].[0-9]' '[0-9].[0-9].[0-9][0-9]' \ - '[0-9].[0-9][0-9].[0-9]' '[0-9].[0-9][0-9].[0-9][0-9]' \ - '[0-9][0-9].[0-9].[0-9]' '[0-9][0-9].[0-9].[0-9][0-9]' \ - '[0-9][0-9].[0-9][0-9].[0-9]' \ - '[0-9][0-9].[0-9][0-9].[0-9][0-9]'; do - (test ! "${srcroot}" && cd "${srcroot}"; git describe --long --abbrev=40 --match="${pattern}") > "${objroot}VERSION.tmp" 2>/dev/null - if test $? -eq 0 ; then - mv "${objroot}VERSION.tmp" "${objroot}VERSION" - break - fi - done - fi - rm -f "${objroot}VERSION.tmp" + enable_libdl="1" fi -if test ! -e "${objroot}VERSION" ; then - if test ! -e "${srcroot}VERSION" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: Missing VERSION file, and unable to generate it; creating bogus VERSION" >&5 -$as_echo "Missing VERSION file, and unable to generate it; creating bogus VERSION" >&6; } - echo "0.0.0-0-g0000000000000000000000000000000000000000" > "${objroot}VERSION" - else - cp ${srcroot}VERSION ${objroot}VERSION - fi -fi -jemalloc_version=`cat "${objroot}VERSION"` -jemalloc_version_major=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print $1}'` -jemalloc_version_minor=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print $2}'` -jemalloc_version_bugfix=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print $3}'` -jemalloc_version_nrev=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print $4}'` -jemalloc_version_gid=`echo ${jemalloc_version} | tr ".g-" " " | awk '{print $5}'` - - - - - - if test "x$abi" != "xpecoff" ; then @@ -10263,7 +10691,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : - T_APPEND_V=-lpthread + T_APPEND_V=-pthread if test "x${LIBS}" = "x" -o "x${T_APPEND_V}" = "x" ; then LIBS="${LIBS}${T_APPEND_V}" else @@ -10334,8 +10762,10 @@ fi wrap_syms="${wrap_syms} pthread_create" have_pthread="1" + + if test "x$enable_libdl" = "x1" ; then have_dlsym="1" - for ac_header in dlfcn.h + for ac_header in dlfcn.h do : ac_fn_c_check_header_mongrel "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default" if test "x$ac_cv_header_dlfcn_h" = xyes; then : @@ -10396,11 +10826,15 @@ fi done - if test "x$have_dlsym" = "x1" ; then - $as_echo "#define JEMALLOC_HAVE_DLSYM " >>confdefs.h + if test "x$have_dlsym" = "x1" ; then + $as_echo "#define JEMALLOC_HAVE_DLSYM " >>confdefs.h + fi + else + have_dlsym="0" fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthread_atfork(3) is compilable" >&5 $as_echo_n "checking whether pthread_atfork(3) is compilable... " >&6; } if ${je_cv_pthread_atfork+:} false; then : @@ -11149,6 +11583,46 @@ $as_echo "$je_cv_gcc_atomic_atomics" >&6; } if test "x${je_cv_gcc_atomic_atomics}" = "xyes" ; then $as_echo "#define JEMALLOC_GCC_ATOMIC_ATOMICS 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GCC 8-bit __atomic atomics is compilable" >&5 +$as_echo_n "checking whether GCC 8-bit __atomic atomics is compilable... " >&6; } +if ${je_cv_gcc_u8_atomic_atomics+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ + + unsigned char x = 0; + int val = 1; + int y = __atomic_fetch_add(&x, val, __ATOMIC_RELAXED); + int after_add = (int)x; + return after_add == 1; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + je_cv_gcc_u8_atomic_atomics=yes +else + je_cv_gcc_u8_atomic_atomics=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_gcc_u8_atomic_atomics" >&5 +$as_echo "$je_cv_gcc_u8_atomic_atomics" >&6; } + + if test "x${je_cv_gcc_u8_atomic_atomics}" = "xyes" ; then + $as_echo "#define JEMALLOC_GCC_U8_ATOMIC_ATOMICS 1" >>confdefs.h + + fi fi @@ -11189,6 +11663,45 @@ $as_echo "$je_cv_gcc_sync_atomics" >&6; } if test "x${je_cv_gcc_sync_atomics}" = "xyes" ; then $as_echo "#define JEMALLOC_GCC_SYNC_ATOMICS 1" >>confdefs.h + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GCC 8-bit __sync atomics is compilable" >&5 +$as_echo_n "checking whether GCC 8-bit __sync atomics is compilable... " >&6; } +if ${je_cv_gcc_u8_sync_atomics+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +int +main () +{ + + unsigned char x = 0; + int before_add = __sync_fetch_and_add(&x, 1); + int after_add = (int)x; + return (before_add == 0) && (after_add == 1); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + je_cv_gcc_u8_sync_atomics=yes +else + je_cv_gcc_u8_sync_atomics=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_gcc_u8_sync_atomics" >&5 +$as_echo "$je_cv_gcc_u8_sync_atomics" >&6; } + + if test "x${je_cv_gcc_u8_sync_atomics}" = "xyes" ; then + $as_echo "#define JEMALLOC_GCC_U8_SYNC_ATOMICS 1" >>confdefs.h + + fi fi @@ -11445,102 +11958,6 @@ esac fi - - -if test "x${je_cv_atomic9}" != "xyes" -a "x${je_cv_osatomic}" != "xyes" ; then - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to force 32-bit __sync_{add,sub}_and_fetch()" >&5 -$as_echo_n "checking whether to force 32-bit __sync_{add,sub}_and_fetch()... " >&6; } -if ${je_cv_sync_compare_and_swap_4+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 - { - uint32_t x32 = 0; - __sync_add_and_fetch(&x32, 42); - __sync_sub_and_fetch(&x32, 1); - } - #else - #error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 is defined, no need to force - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - je_cv_sync_compare_and_swap_4=yes -else - je_cv_sync_compare_and_swap_4=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_sync_compare_and_swap_4" >&5 -$as_echo "$je_cv_sync_compare_and_swap_4" >&6; } - - if test "x${je_cv_sync_compare_and_swap_4}" = "xyes" ; then - $as_echo "#define JE_FORCE_SYNC_COMPARE_AND_SWAP_4 " >>confdefs.h - - fi - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to force 64-bit __sync_{add,sub}_and_fetch()" >&5 -$as_echo_n "checking whether to force 64-bit __sync_{add,sub}_and_fetch()... " >&6; } -if ${je_cv_sync_compare_and_swap_8+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include - -int -main () -{ - - #ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 - { - uint64_t x64 = 0; - __sync_add_and_fetch(&x64, 42); - __sync_sub_and_fetch(&x64, 1); - } - #else - #error __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 is defined, no need to force - #endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - je_cv_sync_compare_and_swap_8=yes -else - je_cv_sync_compare_and_swap_8=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_sync_compare_and_swap_8" >&5 -$as_echo "$je_cv_sync_compare_and_swap_8" >&6; } - - if test "x${je_cv_sync_compare_and_swap_8}" = "xyes" ; then - $as_echo "#define JE_FORCE_SYNC_COMPARE_AND_SWAP_8 " >>confdefs.h - - fi - -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_clz" >&5 $as_echo_n "checking for __builtin_clz... " >&6; } if ${je_cv_builtin_clz+:} false; then : @@ -11628,47 +12045,6 @@ if test "x${je_cv_os_unfair_lock}" = "xyes" ; then fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Darwin OSSpin*() is compilable" >&5 -$as_echo_n "checking whether Darwin OSSpin*() is compilable... " >&6; } -if ${je_cv_osspin+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include - -int -main () -{ - - OSSpinLock lock = 0; - OSSpinLockLock(&lock); - OSSpinLockUnlock(&lock); - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - je_cv_osspin=yes -else - je_cv_osspin=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $je_cv_osspin" >&5 -$as_echo "$je_cv_osspin" >&6; } - -if test "x${je_cv_osspin}" = "xyes" ; then - $as_echo "#define JEMALLOC_OSSPIN " >>confdefs.h - -fi - - # Check whether --enable-zone-allocator was given. if test "${enable_zone_allocator+set}" = set; then : enableval=$enable_zone_allocator; if test "x$enable_zone_allocator" = "xno" ; then @@ -11720,9 +12096,7 @@ else fi -if test "x${have_pthread}" = "x1" -a "x${have_dlsym}" = "x1" \ - -a "x${je_cv_os_unfair_lock}" != "xyes" \ - -a "x${je_cv_osspin}" != "xyes" ; then +if test "x${have_pthread}" = "x1" -a "x${je_cv_os_unfair_lock}" != "xyes" ; then $as_echo "#define JEMALLOC_BACKGROUND_THREAD 1" >>confdefs.h fi @@ -12168,8 +12542,6 @@ ac_config_commands="$ac_config_commands include/jemalloc/internal/public_namespa ac_config_commands="$ac_config_commands include/jemalloc/internal/public_unnamespace.h" -ac_config_commands="$ac_config_commands include/jemalloc/internal/size_classes.h" - ac_config_commands="$ac_config_commands include/jemalloc/jemalloc_protos_jet.h" ac_config_commands="$ac_config_commands include/jemalloc/jemalloc_rename.h" @@ -12913,13 +13285,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 objroot="${objroot}" - SHELL="${SHELL}" - srcdir="${srcdir}" - objroot="${objroot}" - LG_QUANTA="${LG_QUANTA}" - LG_PAGE_SIZES="${LG_PAGE_SIZES}" - - srcdir="${srcdir}" objroot="${objroot}" @@ -12954,7 +13319,6 @@ do "include/jemalloc/internal/private_symbols_jet.awk") CONFIG_COMMANDS="$CONFIG_COMMANDS include/jemalloc/internal/private_symbols_jet.awk" ;; "include/jemalloc/internal/public_namespace.h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/jemalloc/internal/public_namespace.h" ;; "include/jemalloc/internal/public_unnamespace.h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/jemalloc/internal/public_unnamespace.h" ;; - "include/jemalloc/internal/size_classes.h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/jemalloc/internal/size_classes.h" ;; "include/jemalloc/jemalloc_protos_jet.h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/jemalloc/jemalloc_protos_jet.h" ;; "include/jemalloc/jemalloc_rename.h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/jemalloc/jemalloc_rename.h" ;; "include/jemalloc/jemalloc_mangle.h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/jemalloc/jemalloc_mangle.h" ;; @@ -13556,10 +13920,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} "include/jemalloc/internal/public_unnamespace.h":C) mkdir -p "${objroot}include/jemalloc/internal" "${srcdir}/include/jemalloc/internal/public_unnamespace.sh" "${objroot}include/jemalloc/internal/public_symbols.txt" > "${objroot}include/jemalloc/internal/public_unnamespace.h" - ;; - "include/jemalloc/internal/size_classes.h":C) - mkdir -p "${objroot}include/jemalloc/internal" - "${SHELL}" "${srcdir}/include/jemalloc/internal/size_classes.sh" "${LG_QUANTA}" 3 "${LG_PAGE_SIZES}" 2 > "${objroot}include/jemalloc/internal/size_classes.h" ;; "include/jemalloc/jemalloc_protos_jet.h":C) mkdir -p "${objroot}include/jemalloc" @@ -13700,12 +14060,20 @@ $as_echo " : ${JEMALLOC_PRIVATE_NAMESPACE}" >&6; } $as_echo "install_suffix : ${install_suffix}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: malloc_conf : ${config_malloc_conf}" >&5 $as_echo "malloc_conf : ${config_malloc_conf}" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: documentation : ${enable_doc}" >&5 +$as_echo "documentation : ${enable_doc}" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: shared libs : ${enable_shared}" >&5 +$as_echo "shared libs : ${enable_shared}" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: static libs : ${enable_static}" >&5 +$as_echo "static libs : ${enable_static}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: autogen : ${enable_autogen}" >&5 $as_echo "autogen : ${enable_autogen}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: debug : ${enable_debug}" >&5 $as_echo "debug : ${enable_debug}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: stats : ${enable_stats}" >&5 $as_echo "stats : ${enable_stats}" >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: experimetal_smallocx : ${enable_experimental_smallocx}" >&5 +$as_echo "experimetal_smallocx : ${enable_experimental_smallocx}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: prof : ${enable_prof}" >&5 $as_echo "prof : ${enable_prof}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: prof-libunwind : ${enable_prof_libunwind}" >&5 diff --git a/jemalloc-sys/jemalloc b/jemalloc-sys/jemalloc index 61efbda709..ea6b3e973b 160000 --- a/jemalloc-sys/jemalloc +++ b/jemalloc-sys/jemalloc @@ -1 +1 @@ -Subproject commit 61efbda7098de6fe64c362d309824864308c36d4 +Subproject commit ea6b3e973b477b8061e0076bb257dbd7f3faa756 From 7f0821df9a0e9dff4cf8f8351bfe12eff1d283fd Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 20 Jul 2020 14:09:58 +0800 Subject: [PATCH 2/5] disable verifying configure Signed-off-by: Jay Lee --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index be0b48da97..a76b155870 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,7 +46,7 @@ jobs: - name: "powerpc64le-unknown-linux-gnu" env: TARGET=powerpc64le-unknown-linux-gnu NO_JEMALLOC_TESTS=1 - name: "x86_64-unknown-linux-gnu (nightly)" - env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 JEMALLOC_SYS_VERIFY_CONFIGURE=1 + env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 # JEMALLOC_SYS_VERIFY_CONFIGURE=1 install: rustup component add llvm-tools-preview addons: &valgrind apt: From 3063466988dcb7c33af79d4141f31f18f71648a6 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 20 Jul 2020 15:41:58 +0800 Subject: [PATCH 3/5] *: simplify ci and build Signed-off-by: Jay Lee --- .travis.yml | 72 ++++------------------------------------ Cross.toml | 16 --------- ci/run.sh | 74 ++++++++++++++---------------------------- jemalloc-sys/README.md | 4 --- jemalloc-sys/build.rs | 53 +++--------------------------- 5 files changed, 36 insertions(+), 183 deletions(-) delete mode 100644 Cross.toml diff --git a/.travis.yml b/.travis.yml index a76b155870..a6b97206e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,62 +6,18 @@ jobs: include: # Linux - name: "aarch64-unknown-linux-gnu" - env: TARGET=aarch64-unknown-linux-gnu NO_JEMALLOC_TESTS=1 - - name: "arm-unknown-linux-gnueabi" - env: TARGET=arm-unknown-linux-gnueabi NO_JEMALLOC_TESTS=1 - - name: "armv7-unknown-linux-gnueabihf" - env: TARGET=armv7-unknown-linux-gnueabihf NO_JEMALLOC_TESTS=1 - - name: "i586-unknown-linux-gnu" - env: TARGET=i586-unknown-linux-gnu - addons: &gcc_multilib - apt: - packages: - - gcc-multilib - - name: "i686-unknown-linux-gnu (nightly)" - env: TARGET=i686-unknown-linux-gnu - addons: *gcc_multilib - - name: "i686-unknown-linux-gnu (beta)" - env: TARGET=i686-unknown-linux-gnu - addons: *gcc_multilib - rust: beta - - name: "i686-unknown-linux-gnu (stable)" - env: TARGET=i686-unknown-linux-gnu - addons: *gcc_multilib - rust: stable - # FIXME: blocked onhttps://github.com/jemalloc/jemalloc/issues/1464 - # - name: "i686-unknown-linux-musl" - # env: TARGET=i686-unknown-linux-musl NOBGT=1 NO_JEMALLOC_TESTS=1 - - name: "mips-unknown-linux-gnu" - env: TARGET=mips-unknown-linux-gnu NO_JEMALLOC_TESTS=1 - - name: "mips64-unknown-linux-gnuabi64" - env: TARGET=mips64-unknown-linux-gnuabi64 NO_JEMALLOC_TESTS=1 - - name: "mips64el-unknown-linux-gnuabi64" - env: TARGET=mips64el-unknown-linux-gnuabi64 NO_JEMALLOC_TESTS=1 - - name: "mipsel-unknown-linux-gnu" - env: TARGET=mipsel-unknown-linux-gnu NO_JEMALLOC_TESTS=1 - - name: "powerpc-unknown-linux-gnu" - env: TARGET=powerpc-unknown-linux-gnu NO_JEMALLOC_TESTS=1 - - name: "powerpc64-unknown-linux-gnu" - env: TARGET=powerpc64-unknown-linux-gnu NO_JEMALLOC_TESTS=1 + env: TARGET=aarch64-unknown-linux-gnu + arch: arm64 - name: "powerpc64le-unknown-linux-gnu" - env: TARGET=powerpc64le-unknown-linux-gnu NO_JEMALLOC_TESTS=1 + env: TARGET=powerpc64le-unknown-linux-gnu + arch: ppc64le - name: "x86_64-unknown-linux-gnu (nightly)" - env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 # JEMALLOC_SYS_VERIFY_CONFIGURE=1 + env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 install: rustup component add llvm-tools-preview addons: &valgrind apt: packages: - valgrind - - autoconf - - name: "x86_64-unknown-linux-gnu (nightly - jemalloc's dev branch)" - env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 JEMALLOC_SYS_GIT_DEV_BRANCH=1 - install: rustup component add llvm-tools-preview - addons: *valgrind - - name: "x86_64-unknown-linux-gnu (beta)" - env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 - rust: beta - install: rustup component add llvm-tools-preview - addons: *valgrind - name: "x86_64-unknown-linux-gnu (stable)" env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 rust: stable @@ -77,12 +33,6 @@ jobs: - name: "x86_64-unknown-linux-musl" env: TARGET=x86_64-unknown-linux-musl NOBGT=1 NO_JEMALLOC_TESTS=1 - # Android - - name: "aarch64-linux-android" - env: TARGET=aarch64-linux-android NO_JEMALLOC_TESTS=1 - - name: "x86_64-linux-android" - env: TARGET=x86_64-linux-android - # OSX # FIXME: cannot jemalloc tests fail due to: # https://github.com/jemalloc/jemalloc/issues/1320 @@ -90,20 +40,10 @@ jobs: # FIXME: valgrind fails on OSX # https://github.com/gnzlbg/jemallocator/issues/86 - name: "x86_64-apple-darwin (nightly)" - env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1 # JEMALLOC_SYS_VERIFY_CONFIGURE=1 - os: osx - osx_image: xcode10 - install: rustup component add llvm-tools-preview - - name: "x86_64-apple-darwin (nightly - jemalloc's dev branch)" - env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1 JEMALLOC_SYS_GIT_DEV_BRANCH=1 - os: osx - osx_image: xcode10 - install: rustup component add llvm-tools-preview - - name: "x86_64-apple-darwin (beta)" env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1 os: osx osx_image: xcode10 - rust: beta + install: rustup component add llvm-tools-preview install: rustup component add llvm-tools-preview - name: "x86_64-apple-darwin (stable)" env: TARGET=x86_64-apple-darwin NO_JEMALLOC_TESTS=1 diff --git a/Cross.toml b/Cross.toml deleted file mode 100644 index 5c50b42d3e..0000000000 --- a/Cross.toml +++ /dev/null @@ -1,16 +0,0 @@ -[build.env] -passthrough = [ - "RUST_BACKTRACE", - "RUST_TEST_THREADS", - "RUST_TEST_NOCAPTURE", - "NO_JEMALLOC_TESTS", - "TERM", - "JEMALLOC_SYS_RUN_JEMALLOC_TESTS", - "JEMALLOC_SYS_VERIFY_CONFIGURE", - "JEMALLOC_SYS_GIT_DEV_BRANCH", - "JEMALLOC_SYS_WITH_MALLOC_CONF", - "JEMALLOC_SYS_WITH_LG_PAGE", - "JEMALLOC_SYS_WITH_LG_HUGEPAGE", - "JEMALLOC_SYS_WITH_LG_QUANTUM", - "JEMALLOC_SYS_WITH_LG_VADDR" -] \ No newline at end of file diff --git a/ci/run.sh b/ci/run.sh index 5246ea53f0..eacd191d24 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -8,7 +8,6 @@ echo "Running tests for target: ${TARGET}, Rust version=${TRAVIS_RUST_VERSION}" export RUST_BACKTRACE=1 export RUST_TEST_THREADS=1 export RUST_TEST_NOCAPTURE=1 -export CARGO_CMD=cross # FIXME: workaround cargo breaking Travis-CI again: # https://github.com/rust-lang/cargo/issues/5721 @@ -25,18 +24,6 @@ else export JEMALLOC_SYS_RUN_JEMALLOC_TESTS=1 fi -# Use cargo on native CI platforms: -case "${TARGET}" in - "x86_64-unknown-linux-gnu") export CARGO_CMD=cargo ;; - *"windows"*) export CARGO_CMD=cargo ;; - *"apple"*) export CARGO_CMD=cargo ;; -esac - -if [ "${CARGO_CMD}" = "cross" ] -then - cargo install cross || echo "cross is already installed" -fi - if [ "${VALGRIND}" = "1" ] then case "${TARGET}" in @@ -53,10 +40,14 @@ then esac fi +if [ "${TARGET}" = "x86_64-unknown-linux-musl" ]; then + rustup toolchain install stable-x86_64-unknown-linux-musl +fi + if [ "${TARGET}" = "x86_64-unknown-linux-gnu" ] || [ "${TARGET}" = "x86_64-apple-darwin" ] then # Not using tee to avoid too much logs that exceeds travis' limit. - if ! ${CARGO_CMD} build -vv --target "${TARGET}" > build_no_std.txt 2>&1; then + if ! cargo build -vv --target "${TARGET}" > build_no_std.txt 2>&1; then tail -n 1024 build_no_std.txt exit 1 fi @@ -75,42 +66,28 @@ then done fi -${CARGO_CMD} test --target "${TARGET}" +cargo test --target "${TARGET}" +cargo test --target "${TARGET}" --features profiling +cargo test --target "${TARGET}" --features debug +cargo test --target "${TARGET}" --features stats +cargo test --target "${TARGET}" --features 'debug profiling' -if [ "${JEMALLOC_SYS_GIT_DEV_BRANCH}" = "1" ]; then - # FIXME: profiling tests broken on dev-branch - # https://github.com/jemalloc/jemalloc/issues/1477 - : -else - ${CARGO_CMD} test --target "${TARGET}" --features profiling -fi - -${CARGO_CMD} test --target "${TARGET}" --features debug -${CARGO_CMD} test --target "${TARGET}" --features stats -if [ "${JEMALLOC_SYS_GIT_DEV_BRANCH}" = "1" ]; then - # FIXME: profiling tests broken on dev-branch - # https://github.com/jemalloc/jemalloc/issues/1477 - : -else - ${CARGO_CMD} test --target "${TARGET}" --features 'debug profiling' -fi - -${CARGO_CMD} test --target "${TARGET}" \ - --features unprefixed_malloc_on_supported_platforms -${CARGO_CMD} test --target "${TARGET}" --no-default-features -${CARGO_CMD} test --target "${TARGET}" --no-default-features \ - --features background_threads_runtime_support +cargo test --target "${TARGET}" \ + --features unprefixed_malloc_on_supported_platforms +cargo test --target "${TARGET}" --no-default-features +cargo test --target "${TARGET}" --no-default-features \ + --features background_threads_runtime_support if [ "${NOBGT}" = "1" ] then echo "enabling background threads by default at run-time is not tested" else - ${CARGO_CMD} test --target "${TARGET}" --features background_threads + cargo test --target "${TARGET}" --features background_threads fi -${CARGO_CMD} test --target "${TARGET}" --release -${CARGO_CMD} test --target "${TARGET}" --manifest-path jemalloc-sys/Cargo.toml -${CARGO_CMD} test --target "${TARGET}" \ +cargo test --target "${TARGET}" --release +cargo test --target "${TARGET}" --manifest-path jemalloc-sys/Cargo.toml +cargo test --target "${TARGET}" \ --manifest-path jemalloc-sys/Cargo.toml \ --features unprefixed_malloc_on_supported_platforms @@ -120,9 +97,9 @@ case "${TARGET}" in "x86_64-unknown-linux-musl") ;; *) - ${CARGO_CMD} test --target "${TARGET}" \ - --manifest-path jemalloc-ctl/Cargo.toml \ - --no-default-features + cargo test --target "${TARGET}" \ + --manifest-path jemalloc-ctl/Cargo.toml \ + --no-default-features # FIXME: cross fails to pass features to jemalloc-ctl # ${CARGO_CMD} test --target "${TARGET}" \ # --manifest-path jemalloc-ctl \ @@ -130,10 +107,9 @@ case "${TARGET}" in ;; esac -${CARGO_CMD} test --target "${TARGET}" -p systest -${CARGO_CMD} test --target "${TARGET}" \ - --manifest-path jemallocator-global/Cargo.toml -${CARGO_CMD} test --target "${TARGET}" \ +cargo test --target "${TARGET}" -p systest +cargo test --target "${TARGET}" --manifest-path jemallocator-global/Cargo.toml +cargo test --target "${TARGET}" \ --manifest-path jemallocator-global/Cargo.toml \ --features force_global_jemalloc diff --git a/jemalloc-sys/README.md b/jemalloc-sys/README.md index e7547574bd..c363900bbb 100644 --- a/jemalloc-sys/README.md +++ b/jemalloc-sys/README.md @@ -144,10 +144,6 @@ hyphens `-` are replaced with underscores `_`(see virtual address size on those platforms where it knows how, and picks a default otherwise. This option may be useful when cross-compiling. -* `JEMALLOC_SYS_GIT_DEV_BRANCH`: when this environment variable is defined, the - latest commit from `jemalloc`'s dev branch is fetched from - `https://github.com/jemalloc/jemalloc` and built. - [jemalloc_install]: https://github.com/jemalloc/jemalloc/blob/dev/INSTALL.md#advanced-configuration ## License diff --git a/jemalloc-sys/build.rs b/jemalloc-sys/build.rs index 3424cffe3d..dac743149e 100644 --- a/jemalloc-sys/build.rs +++ b/jemalloc-sys/build.rs @@ -131,23 +131,7 @@ fn main() { info!("CFLAGS={:?}", cflags); assert!(out_dir.exists(), "OUT_DIR does not exist"); - let (jemalloc_repo_dir, run_autoconf) = if env::var("JEMALLOC_SYS_GIT_DEV_BRANCH").is_ok() { - let jemalloc_repo = out_dir.join("jemalloc_repo"); - if jemalloc_repo.exists() { - fs::remove_dir_all(jemalloc_repo.clone()).unwrap(); - } - let mut cmd = Command::new("git"); - cmd.arg("clone") - .arg("--depth=1") - .arg("--branch=dev") - .arg("--") - .arg("https://github.com/jemalloc/jemalloc") - .arg(format!("{}", jemalloc_repo.display())); - run(&mut cmd); - (jemalloc_repo, true) - } else { - (PathBuf::from("jemalloc"), false) - }; + let jemalloc_repo_dir = PathBuf::from("jemalloc"); info!("JEMALLOC_REPO_DIR={:?}", jemalloc_repo_dir); let jemalloc_src_dir = out_dir.join("jemalloc"); @@ -168,37 +152,10 @@ fn main() { // Configuration files let config_files = ["configure" /*"VERSION"*/]; - // Verify that the configuration files are up-to-date - let verify_configure = env::var("JEMALLOC_SYS_VERIFY_CONFIGURE").is_ok(); - if verify_configure || run_autoconf { - info!("Verifying that configuration files in `configure/` are up-to-date... "); - - // The configuration file from the configure/directory should be used. - // The jemalloc git submodule shouldn't contain any configuration files. - assert!( - !jemalloc_src_dir.join("configure").exists(), - "the jemalloc submodule contains configuration files" - ); - - // Run autoconf: - let mut cmd = Command::new("autoconf"); - cmd.current_dir(jemalloc_src_dir.clone()); - run(&mut cmd); - - for f in &config_files { - if verify_configure { - let mut cmd = Command::new("diff"); - run(cmd - .arg(&jemalloc_src_dir.join(f)) - .arg(&Path::new("configure").join(f))); - } - } - } else { - // Copy the configuration files to jemalloc's source directory - for f in &config_files { - fs::copy(Path::new("configure").join(f), jemalloc_src_dir.join(f)) - .expect("failed to copy config file to OUT_DIR"); - } + // Copy the configuration files to jemalloc's source directory + for f in &config_files { + fs::copy(Path::new("configure").join(f), jemalloc_src_dir.join(f)) + .expect("failed to copy config file to OUT_DIR"); } // Run configure: From b987121073e24f477fb466ca4260a3c36de3d486 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 20 Jul 2020 16:05:37 +0800 Subject: [PATCH 4/5] fix wrong version Signed-off-by: Jay Lee --- jemalloc-sys/build.rs | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/jemalloc-sys/build.rs b/jemalloc-sys/build.rs index dac743149e..f8e04bed18 100644 --- a/jemalloc-sys/build.rs +++ b/jemalloc-sys/build.rs @@ -116,8 +116,6 @@ fn main() { println!("cargo:rustc-link-lib={}={}", kind, &stem[3..]); return; } - - fs::create_dir_all(&build_dir).unwrap(); // Disable -Wextra warnings - jemalloc doesn't compile free of warnings with // it enabled: https://github.com/jemalloc/jemalloc/issues/1196 let compiler = cc::Build::new().extra_warnings(false).get_compiler(); @@ -134,32 +132,28 @@ fn main() { let jemalloc_repo_dir = PathBuf::from("jemalloc"); info!("JEMALLOC_REPO_DIR={:?}", jemalloc_repo_dir); - let jemalloc_src_dir = out_dir.join("jemalloc"); - info!("JEMALLOC_SRC_DIR={:?}", jemalloc_src_dir); - - if jemalloc_src_dir.exists() { - fs::remove_dir_all(jemalloc_src_dir.clone()).unwrap(); + if build_dir.exists() { + fs::remove_dir_all(build_dir.clone()).unwrap(); } - // Copy jemalloc submodule to the OUT_DIR let mut copy_options = fs_extra::dir::CopyOptions::new(); copy_options.overwrite = true; copy_options.copy_inside = true; - fs_extra::dir::copy(&jemalloc_repo_dir, &jemalloc_src_dir, ©_options) + fs_extra::dir::copy(&jemalloc_repo_dir, &build_dir, ©_options) .expect("failed to copy jemalloc source code to OUT_DIR"); - assert!(jemalloc_src_dir.exists()); + assert!(build_dir.exists()); // Configuration files - let config_files = ["configure" /*"VERSION"*/]; + let config_files = ["configure", "VERSION"]; // Copy the configuration files to jemalloc's source directory for f in &config_files { - fs::copy(Path::new("configure").join(f), jemalloc_src_dir.join(f)) + fs::copy(Path::new("configure").join(f), build_dir.join(f)) .expect("failed to copy config file to OUT_DIR"); } // Run configure: - let configure = jemalloc_src_dir.join("configure"); + let configure = build_dir.join("configure"); let mut cmd = Command::new("sh"); cmd.arg( configure @@ -274,7 +268,6 @@ fn main() { let make = make_cmd(&host); run(Command::new(make) .current_dir(&build_dir) - .arg("srcroot=../jemalloc/") .arg("-j") .arg(num_jobs.clone())); @@ -283,22 +276,17 @@ fn main() { // Make tests: run(Command::new(make) .current_dir(&build_dir) - .arg("srcroot=../jemalloc/") .arg("-j") .arg(num_jobs.clone()) .arg("tests")); // Run tests: - run(Command::new(make) - .current_dir(&build_dir) - .arg("srcroot=../jemalloc/") - .arg("check")); + run(Command::new(make).current_dir(&build_dir).arg("check")); } // Make install: run(Command::new(make) .current_dir(&build_dir) - .arg("srcroot=../jemalloc/") .arg("install_lib_static") .arg("install_include") .arg("-j") From 7b268d1e564ed7bcde65a5826c3831f0d1b1ed36 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Mon, 20 Jul 2020 17:04:59 +0800 Subject: [PATCH 5/5] fix CI Signed-off-by: Jay Lee --- .travis.yml | 9 +++++++-- ci/run.sh | 4 ---- jemalloc-sys/build.rs | 13 ++++++++++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index a6b97206e6..3e46c18626 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,10 @@ jobs: include: # Linux - name: "aarch64-unknown-linux-gnu" - env: TARGET=aarch64-unknown-linux-gnu + env: TARGET=aarch64-unknown-linux-gnu NO_JEMALLOC_TESTS=1 arch: arm64 - name: "powerpc64le-unknown-linux-gnu" - env: TARGET=powerpc64le-unknown-linux-gnu + env: TARGET=powerpc64le-unknown-linux-gnu NO_JEMALLOC_TESTS=1 arch: ppc64le - name: "x86_64-unknown-linux-gnu (nightly)" env: TARGET=x86_64-unknown-linux-gnu VALGRIND=1 @@ -32,6 +32,11 @@ jobs: # - cargo test --features=alloc_trait --bench roundtrip - name: "x86_64-unknown-linux-musl" env: TARGET=x86_64-unknown-linux-musl NOBGT=1 NO_JEMALLOC_TESTS=1 + install: rustup target add x86_64-unknown-linux-musl + addons: + apt: + packages: + musl-tools # OSX # FIXME: cannot jemalloc tests fail due to: diff --git a/ci/run.sh b/ci/run.sh index eacd191d24..5eda43df6e 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -40,10 +40,6 @@ then esac fi -if [ "${TARGET}" = "x86_64-unknown-linux-musl" ]; then - rustup toolchain install stable-x86_64-unknown-linux-musl -fi - if [ "${TARGET}" = "x86_64-unknown-linux-gnu" ] || [ "${TARGET}" = "x86_64-apple-darwin" ] then # Not using tee to avoid too much logs that exceeds travis' limit. diff --git a/jemalloc-sys/build.rs b/jemalloc-sys/build.rs index f8e04bed18..a25b34496d 100644 --- a/jemalloc-sys/build.rs +++ b/jemalloc-sys/build.rs @@ -262,7 +262,7 @@ fn main() { cmd.arg(format!("--build={}", gnu_target(&host))); cmd.arg(format!("--prefix={}", out_dir.display())); - run(&mut cmd); + run_and_log(&mut cmd, &build_dir.join("config.log")); // Make: let make = make_cmd(&host); @@ -315,13 +315,24 @@ fn main() { println!("cargo:rerun-if-changed=jemalloc"); } +fn run_and_log(cmd: &mut Command, log_file: &Path) { + execute(cmd, || { + run(Command::new("tail").arg("-n").arg("100").arg(log_file)); + }) +} + fn run(cmd: &mut Command) { + execute(cmd, || ()); +} + +fn execute(cmd: &mut Command, on_fail: impl FnOnce()) { println!("running: {:?}", cmd); let status = match cmd.status() { Ok(status) => status, Err(e) => panic!("failed to execute command: {}", e), }; if !status.success() { + on_fail(); panic!( "command did not execute successfully: {:?}\n\ expected success, got: {}",