diff --git a/jemalloc-sys/Cargo.toml b/jemalloc-sys/Cargo.toml index 9b3d922f1..7e53840b5 100644 --- a/jemalloc-sys/Cargo.toml +++ b/jemalloc-sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tikv-jemalloc-sys" -version = "0.7.0+5.3.1-0-g81034ce1f1373e37dc865038e1bc8eeecf559ce8" +version = "0.7.0+5.4.0-0-g7a34f18502e7b222724097cdcd499b437d189acc" authors = [ "Alex Crichton ", "Gonzalo Brito Gadeschi ", diff --git a/jemalloc-sys/README.md b/jemalloc-sys/README.md index e67a4e930..b3fe497ae 100644 --- a/jemalloc-sys/README.md +++ b/jemalloc-sys/README.md @@ -19,7 +19,7 @@ [jemalloc_docs]: http://jemalloc.net/jemalloc.3.html [jemalloc_wiki]: https://github.com/jemalloc/jemalloc/wiki -**Current jemalloc version**: 5.3.1. +**Current jemalloc version**: 5.4.0. ## Platform support diff --git a/jemalloc-sys/configure/configure b/jemalloc-sys/configure/configure index a6ac459e5..869357b3d 100755 --- a/jemalloc-sys/configure/configure +++ b/jemalloc-sys/configure/configure @@ -669,6 +669,7 @@ enable_experimental_sdt enable_utrace enable_fill enable_prof +enable_experimental_fiber_safe_tls enable_experimental_smallocx enable_stats enable_debug @@ -677,6 +678,7 @@ install_suffix private_namespace JEMALLOC_CPREFIX JEMALLOC_PREFIX +have_ucontext enable_static enable_shared enable_doc @@ -731,6 +733,8 @@ build EXTRA_CXXFLAGS SPECIFIED_CXXFLAGS CONFIGURE_CXXFLAGS +enable_cxx_infallible_new +enable_cxx_exceptions enable_cxx HAVE_CXX14 HAVE_CXX17 @@ -807,6 +811,7 @@ enable_option_checking with_xslroot enable_cxx with_cxx_stdlib +enable_cxx_infallible_new with_lg_vaddr with_version with_rpath @@ -824,10 +829,10 @@ enable_debug enable_stats enable_user_config enable_experimental_smallocx +enable_experimental_fiber_safe_tls enable_prof enable_prof_libunwind with_static_libunwind -enable_prof_frameptr enable_prof_libgcc enable_prof_gcc enable_dss @@ -1489,6 +1494,9 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-cxx Disable C++ integration + --enable-cxx-infallible-new + Abort on OOM in throwing operator new instead of + throwing std::bad_alloc --enable-autogen Automatically regenerate configure output --enable-doc Build documentation --enable-shared Build shared libaries @@ -1499,10 +1507,12 @@ Optional Features: MALLOC_CONF --enable-experimental-smallocx Enable experimental smallocx API + --enable-experimental-fiber-safe-tls + Make jemalloc's own TLS access safe for fibers that + migrate across threads (partial mitigation; see + INSTALL.md) --enable-prof Enable allocation profiling --enable-prof-libunwind Use libunwind for backtracing - --enable-prof-frameptr Use optimized frame pointer unwinder for backtracing - (Linux only) --disable-prof-libgcc Do not use libgcc for backtracing --disable-prof-gcc Do not use gcc intrinsics for backtracing --disable-dss Disable usage of sbrk(2) @@ -1831,6 +1841,53 @@ fi } # ac_fn_c_try_link +# ac_fn_cxx_try_link LINENO +# ------------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_cxx_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_cxx_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + test -x conftest$ac_exeext + } +then : + ac_retval=0 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_cxx_try_link + # ac_fn_c_try_run LINENO # ---------------------- # Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that @@ -3309,29 +3366,27 @@ abs_objroot="`pwd`/" case "$prefix" in - *\ * ) as_fn_error $? "Prefix should not contain spaces" "$LINENO" 5 ;; "NONE" ) prefix="/usr/local" ;; esac case "$exec_prefix" in - *\ * ) as_fn_error $? "Exec prefix should not contain spaces" "$LINENO" 5 ;; "NONE" ) exec_prefix=$prefix ;; esac PREFIX=$prefix -BINDIR=`eval echo $bindir` -BINDIR=`eval echo $BINDIR` +BINDIR=`eval echo "\"$bindir\""` +BINDIR=`eval echo "\"$BINDIR\""` -INCLUDEDIR=`eval echo $includedir` -INCLUDEDIR=`eval echo $INCLUDEDIR` +INCLUDEDIR=`eval echo "\"$includedir\""` +INCLUDEDIR=`eval echo "\"$INCLUDEDIR\""` -LIBDIR=`eval echo $libdir` -LIBDIR=`eval echo $LIBDIR` +LIBDIR=`eval echo "\"$libdir\""` +LIBDIR=`eval echo "\"$LIBDIR\""` -DATADIR=`eval echo $datadir` -DATADIR=`eval echo $DATADIR` +DATADIR=`eval echo "\"$datadir\""` +DATADIR=`eval echo "\"$DATADIR\""` -MANDIR=`eval echo $mandir` -MANDIR=`eval echo $MANDIR` +MANDIR=`eval echo "\"$mandir\""` +MANDIR=`eval echo "\"$MANDIR\""` # Extract the first word of "xsltproc", so it can be a program name with args. @@ -6253,11 +6308,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } -if test ${ac_cv_prog_cxx_11+y} +if test ${ac_cv_prog_cxx_cxx11+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_11=no + ac_cv_prog_cxx_cxx11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6299,11 +6354,11 @@ if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } -if test ${ac_cv_prog_cxx_98+y} +if test ${ac_cv_prog_cxx_cxx98+y} then : printf %s "(cached) " >&6 else $as_nop - ac_cv_prog_cxx_98=no + ac_cv_prog_cxx_cxx98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7823,6 +7878,134 @@ fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-missing-braces" >&5 +printf %s "checking whether compiler supports -Wno-missing-braces... " >&6; } +T_CONFIGURE_CXXFLAGS="${CONFIGURE_CXXFLAGS}" +T_APPEND_V=-Wno-missing-braces + 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 (void) +{ + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + je_cv_cxxflags_added=-Wno-missing-braces + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + je_cv_cxxflags_added= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CONFIGURE_CXXFLAGS="${T_CONFIGURE_CXXFLAGS}" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam 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 + + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -Wno-missing-field-initializers" >&5 +printf %s "checking whether compiler supports -Wno-missing-field-initializers... " >&6; } +T_CONFIGURE_CXXFLAGS="${CONFIGURE_CXXFLAGS}" +T_APPEND_V=-Wno-missing-field-initializers + 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 (void) +{ + + return 0; + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO" +then : + je_cv_cxxflags_added=-Wno-missing-field-initializers + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + je_cv_cxxflags_added= + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + CONFIGURE_CXXFLAGS="${T_CONFIGURE_CXXFLAGS}" + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam 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 + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -g3" >&5 printf %s "checking whether compiler supports -g3... " >&6; } T_CONFIGURE_CXXFLAGS="${CONFIGURE_CXXFLAGS}" @@ -7968,6 +8151,93 @@ if test "x$enable_cxx" = "x1"; then printf "%s\n" "#define JEMALLOC_ENABLE_CXX " >>confdefs.h fi +if test "x$enable_cxx" = "x1"; then + 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 + + SAVED_CXXFLAGS="${CXXFLAGS}" + CXXFLAGS="${CXXFLAGS} ${EXTRA_CXXFLAGS}" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C++ exception support is compilable" >&5 +printf %s "checking whether C++ exception support is compilable... " >&6; } +if test ${je_cv_cxx_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main (void) +{ + + try { + throw std::bad_alloc(); + } catch (const std::bad_alloc &) { + } + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO" +then : + je_cv_cxx_exceptions=yes +else $as_nop + je_cv_cxx_exceptions=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $je_cv_cxx_exceptions" >&5 +printf "%s\n" "$je_cv_cxx_exceptions" >&6; } + + CXXFLAGS="${SAVED_CXXFLAGS}" + 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${je_cv_cxx_exceptions}" = "xyes" ; then + +printf "%s\n" "#define JEMALLOC_HAVE_CXX_EXCEPTIONS " >>confdefs.h + + enable_cxx_exceptions="1" + else + enable_cxx_exceptions="0" + fi +fi + +# Check whether --enable-cxx-infallible-new was given. +if test ${enable_cxx_infallible_new+y} +then : + enableval=$enable_cxx_infallible_new; if test "x$enable_cxx_infallible_new" = "xno" ; then + enable_cxx_infallible_new="0" +else + enable_cxx_infallible_new="1" +fi + +else $as_nop + enable_cxx_infallible_new="0" + +fi + +if test "x$enable_cxx" != "x1" ; then + enable_cxx_infallible_new="0" +fi +if test "x$enable_cxx_infallible_new" = "x1" ; then + +printf "%s\n" "#define JEMALLOC_INFALLIBLE_NEW 1" >>confdefs.h + +fi + + @@ -8704,9 +8974,9 @@ else $as_nop fi -case "${host_cpu}" in - aarch64) - if test "x$LG_VADDR" = "xdetect"; then +if test "x$LG_VADDR" = "xdetect"; then + case "${host_cpu}" in + aarch64) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of significant virtual address bits" >&5 printf %s "checking number of significant virtual address bits... " >&6; } if test "x${LG_SIZEOF_PTR}" = "x2" ; then @@ -8718,10 +8988,8 @@ printf %s "checking number of significant virtual address bits... " >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LG_VADDR" >&5 printf "%s\n" "$LG_VADDR" >&6; } - fi - ;; - x86_64) - if test "x$LG_VADDR" = "xdetect"; then + ;; + x86_64) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of significant virtual address bits" >&5 printf %s "checking number of significant virtual address bits... " >&6; } if test ${je_cv_lg_vaddr+y} @@ -8788,17 +9056,37 @@ fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $je_cv_lg_vaddr" >&5 printf "%s\n" "$je_cv_lg_vaddr" >&6; } + if test "x${je_cv_lg_vaddr}" = "xerror" ; then + as_fn_error $? "cannot determine number of significant virtual address bits" "$LINENO" 5 + fi if test "x${je_cv_lg_vaddr}" != "x" ; then LG_VADDR="${je_cv_lg_vaddr}" fi - if test "x${LG_VADDR}" != "xerror" ; then + ;; + *) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of significant virtual address bits" >&5 +printf %s "checking number of significant virtual address bits... " >&6; } + if test "x${LG_SIZEOF_PTR}" = "x3" ; then + LG_VADDR=64 + elif test "x${LG_SIZEOF_PTR}" = "x2" ; then + LG_VADDR=32 + elif test "x${LG_SIZEOF_PTR}" = "xLG_SIZEOF_PTR_WIN" ; then + LG_VADDR="(1U << (LG_SIZEOF_PTR_WIN+3))" + else + as_fn_error $? "Unsupported lg(pointer size): ${LG_SIZEOF_PTR}" "$LINENO" 5 + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LG_VADDR" >&5 +printf "%s\n" "$LG_VADDR" >&6; } + ;; + esac +fi printf "%s\n" "#define LG_VADDR $LG_VADDR" >>confdefs.h - else - as_fn_error $? "cannot determine number of significant virtual address bits" "$LINENO" 5 - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking rdtscp support" >&5 + +case "${host_cpu}" in + x86_64) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking rdtscp support" >&5 printf %s "checking rdtscp support... " >&6; } if test ${je_cv_rdtscp+y} then : @@ -8838,34 +9126,14 @@ fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $je_cv_rdtscp" >&5 printf "%s\n" "$je_cv_rdtscp" >&6; } - if test "x${je_cv_rdtscp}" = "xyes"; then + if test "x${je_cv_rdtscp}" = "xyes"; then printf "%s\n" "#define JEMALLOC_HAVE_RDTSCP " >>confdefs.h - fi - fi - ;; - *) - if test "x$LG_VADDR" = "xdetect"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking number of significant virtual address bits" >&5 -printf %s "checking number of significant virtual address bits... " >&6; } - if test "x${LG_SIZEOF_PTR}" = "x3" ; then - LG_VADDR=64 - elif test "x${LG_SIZEOF_PTR}" = "x2" ; then - LG_VADDR=32 - elif test "x${LG_SIZEOF_PTR}" = "xLG_SIZEOF_PTR_WIN" ; then - LG_VADDR="(1U << (LG_SIZEOF_PTR_WIN+3))" - else - as_fn_error $? "Unsupported lg(pointer size): ${LG_SIZEOF_PTR}" "$LINENO" 5 - fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LG_VADDR" >&5 -printf "%s\n" "$LG_VADDR" >&6; } fi ;; esac -printf "%s\n" "#define LG_VADDR $LG_VADDR" >>confdefs.h - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking asm volatile support" >&5 printf %s "checking asm volatile support... " >&6; } if test ${je_cv_asm_volatile+y} @@ -9331,9 +9599,6 @@ fi abi="elf" - -printf "%s\n" "#define JEMALLOC_SYSCTL_VM_OVERCOMMIT " >>confdefs.h - force_lazy_lock="1" ;; *-*-dragonfly*) @@ -9364,9 +9629,6 @@ printf "%s\n" "#define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS " >>confdefs.h printf "%s\n" "#define JEMALLOC_HAS_ALLOCA_H " >>confdefs.h -printf "%s\n" "#define JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY " >>confdefs.h - - printf "%s\n" "#define JEMALLOC_THREADED_INIT " >>confdefs.h @@ -9395,9 +9657,6 @@ printf "%s\n" "#define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS " >>confdefs.h printf "%s\n" "#define JEMALLOC_HAS_ALLOCA_H " >>confdefs.h -printf "%s\n" "#define JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY " >>confdefs.h - - printf "%s\n" "#define JEMALLOC_THREADED_INIT " >>confdefs.h if test "${LG_SIZEOF_PTR}" = "3"; then @@ -9423,9 +9682,6 @@ printf "%s\n" "#define JEMALLOC_PURGE_MADVISE_DONTNEED_ZEROS " >>confdefs.h printf "%s\n" "#define JEMALLOC_HAS_ALLOCA_H " >>confdefs.h -printf "%s\n" "#define JEMALLOC_PROC_SYS_VM_OVERCOMMIT_MEMORY " >>confdefs.h - - printf "%s\n" "#define JEMALLOC_THREADED_INIT " >>confdefs.h @@ -9450,9 +9706,6 @@ fi printf "%s\n" "#define JEMALLOC_HAS_ALLOCA_H " >>confdefs.h -printf "%s\n" "#define JEMALLOC_SYSCTL_VM_OVERCOMMIT " >>confdefs.h - - printf "%s\n" "#define JEMALLOC_THREADED_INIT " >>confdefs.h @@ -11628,6 +11881,50 @@ if test "$enable_shared$enable_static" = "00" ; then fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ucontext is compilable" >&5 +printf %s "checking whether ucontext is compilable... " >&6; } +if test ${je_cv_ucontext+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include + +int +main (void) +{ + + ucontext_t uc, ret; + getcontext(&uc); + makecontext(&uc, (void (*)(void))0, 0); + swapcontext(&ret, &uc); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + je_cv_ucontext=yes +else $as_nop + je_cv_ucontext=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $je_cv_ucontext" >&5 +printf "%s\n" "$je_cv_ucontext" >&6; } + +if test "x${je_cv_ucontext}" = "xyes" ; then + have_ucontext="1" +else + have_ucontext="0" +fi + + + # Check whether --with-mangling was given. if test ${with_mangling+y} then : @@ -12429,6 +12726,27 @@ printf "%s\n" "#define JEMALLOC_EXPERIMENTAL_SMALLOCX_API " >>confdefs.h fi +# Check whether --enable-experimental_fiber_safe_tls was given. +if test ${enable_experimental_fiber_safe_tls+y} +then : + enableval=$enable_experimental_fiber_safe_tls; if test "x$enable_experimental_fiber_safe_tls" = "xno" ; then +enable_experimental_fiber_safe_tls="0" +else +enable_experimental_fiber_safe_tls="1" +fi + +else $as_nop + enable_experimental_fiber_safe_tls="0" + +fi + +if test "x$enable_experimental_fiber_safe_tls" = "x1" ; then + +printf "%s\n" "#define JEMALLOC_EXPERIMENTAL_FIBER_SAFE_TLS " >>confdefs.h + +fi + + # Check whether --enable-prof was given. if test ${enable_prof+y} then : @@ -12564,90 +12882,6 @@ printf "%s\n" "#define JEMALLOC_PROF_LIBUNWIND " >>confdefs.h fi fi -if test `uname -s` = "Linux" -then - # Check whether --enable-prof-frameptr was given. -if test ${enable_prof_frameptr+y} -then : - enableval=$enable_prof_frameptr; if test "x$enable_prof_frameptr" = "xno" ; then - enable_prof_frameptr="0" - else - enable_prof_frameptr="1" - if test "x$enable_prof" = "x0" ; then - as_fn_error $? "--enable-prof-frameptr should only be used with --enable-prof" "$LINENO" 5 - fi - fi - -else $as_nop - enable_prof_frameptr="0" - -fi - - if test "x$backtrace_method" = "x" -a "x$enable_prof_frameptr" = "x1" \ - -a "x$GCC" = "xyes" ; then - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether compiler supports -fno-omit-frame-pointer" >&5 -printf %s "checking whether compiler supports -fno-omit-frame-pointer... " >&6; } -T_CONFIGURE_CFLAGS="${CONFIGURE_CFLAGS}" -T_APPEND_V=-fno-omit-frame-pointer - 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 (void) -{ - - return 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - je_cv_cflags_added=-fno-omit-frame-pointer - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } -else $as_nop - je_cv_cflags_added= - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - CONFIGURE_CFLAGS="${T_CONFIGURE_CFLAGS}" - -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam 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 - - - backtrace_method="frame pointer linux" - -printf "%s\n" "#define JEMALLOC_PROF_FRAME_POINTER " >>confdefs.h - - else - enable_prof_frameptr="0" - fi -else - enable_prof_frameptr="0" -fi - # Check whether --enable-prof-libgcc was given. if test ${enable_prof_libgcc+y} then : @@ -13706,6 +13940,9 @@ printf "%s\n" "#define LG_PAGE $LG_PAGE" >>confdefs.h else as_fn_error $? "cannot determine value for LG_PAGE" "$LINENO" 5 fi +if test "${LG_PAGE}" -lt 8 ; then + as_fn_error $? "LG_PAGE must be at least 8 (PAGE >= 256)" "$LINENO" 5 +fi # Check whether --with-lg_hugepage was given. @@ -13735,8 +13972,8 @@ if test "x${je_cv_lg_hugepage}" = "x" ; then fi fi if test "x${LG_PAGE}" != "xundefined" -a \ - "${je_cv_lg_hugepage}" -lt "${LG_PAGE}" ; then - as_fn_error $? "Huge page size (2^${je_cv_lg_hugepage}) must be at least page size (2^${LG_PAGE})" "$LINENO" 5 + "${je_cv_lg_hugepage}" -le "${LG_PAGE}" ; then + as_fn_error $? "Huge page size (2^${je_cv_lg_hugepage}) must be greater than page size (2^${LG_PAGE})" "$LINENO" 5 fi printf "%s\n" "#define LG_HUGEPAGE ${je_cv_lg_hugepage}" >>confdefs.h @@ -14164,6 +14401,69 @@ printf "%s\n" "$je_cv_pthread_get_name_np" >&6; } printf "%s\n" "#define JEMALLOC_HAVE_PTHREAD_GET_NAME_NP " >>confdefs.h + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthread_condattr_setclock with CLOCK_MONOTONIC is usable" >&5 +printf %s "checking whether pthread_condattr_setclock with CLOCK_MONOTONIC is usable... " >&6; } +if test ${je_cv_pthread_cond_timedwait_monotonic+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : + je_cv_pthread_cond_timedwait_monotonic=no +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include + +int +main (void) +{ + + pthread_condattr_t attr; + pthread_cond_t cond; + struct timespec ts; + int ret = pthread_condattr_init(&attr); + if (ret != 0) { + return 1; + } + ret = pthread_condattr_setclock(&attr, CLOCK_MONOTONIC); + if (ret != 0) { + pthread_condattr_destroy(&attr); + return 1; + } + ret = pthread_cond_init(&cond, &attr); + pthread_condattr_destroy(&attr); + if (ret != 0) { + return 1; + } + ret = clock_gettime(CLOCK_MONOTONIC, &ts); + pthread_cond_destroy(&cond); + return ret != 0; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + je_cv_pthread_cond_timedwait_monotonic=yes +else $as_nop + je_cv_pthread_cond_timedwait_monotonic=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $je_cv_pthread_cond_timedwait_monotonic" >&5 +printf "%s\n" "$je_cv_pthread_cond_timedwait_monotonic" >&6; } + if test "x${je_cv_pthread_cond_timedwait_monotonic}" = "xyes" ; then + +printf "%s\n" "#define JEMALLOC_HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC " >>confdefs.h + fi fi @@ -15844,7 +16144,7 @@ else $as_nop fi -if test "x$enable_pageid" = "x1" ; then +if test "x$enable_pageid" = "x1" -a "x$have_prctl" = "x1" ; then printf "%s\n" "#define JEMALLOC_PAGEID " >>confdefs.h @@ -18351,12 +18651,12 @@ printf "%s\n" "stats : ${enable_stats}" >&6; } printf "%s\n" "user_config : ${enable_user_config}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: experimental_smallocx : ${enable_experimental_smallocx}" >&5 printf "%s\n" "experimental_smallocx : ${enable_experimental_smallocx}" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: experimental_fiber_safe_tls : ${enable_experimental_fiber_safe_tls}" >&5 +printf "%s\n" "experimental_fiber_safe_tls : ${enable_experimental_fiber_safe_tls}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: prof : ${enable_prof}" >&5 printf "%s\n" "prof : ${enable_prof}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: prof-libunwind : ${enable_prof_libunwind}" >&5 printf "%s\n" "prof-libunwind : ${enable_prof_libunwind}" >&6; } -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: prof-frameptr : ${enable_prof_frameptr}" >&5 -printf "%s\n" "prof-frameptr : ${enable_prof_frameptr}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: prof-libgcc : ${enable_prof_libgcc}" >&5 printf "%s\n" "prof-libgcc : ${enable_prof_libgcc}" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: prof-gcc : ${enable_prof_gcc}" >&5 diff --git a/jemalloc-sys/jemalloc b/jemalloc-sys/jemalloc index 81034ce1f..7a34f1850 160000 --- a/jemalloc-sys/jemalloc +++ b/jemalloc-sys/jemalloc @@ -1 +1 @@ -Subproject commit 81034ce1f1373e37dc865038e1bc8eeecf559ce8 +Subproject commit 7a34f18502e7b222724097cdcd499b437d189acc