diff options
author | Jason Evans <jasone@canonware.com> | 2010-01-17 23:51:35 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2010-01-17 23:51:35 (GMT) |
commit | 3363a841ca087947eb42a8f03c546487483e6b44 (patch) | |
tree | 54bf49f2726d93fd5dfc54476535d64916c32f73 /jemalloc | |
parent | 00b5c9334701d10a798ae86cd142df882f28519c (diff) | |
parent | 78d815c9deaf7ce665110d7738482421d25b2ff0 (diff) | |
download | jemalloc-3363a841ca087947eb42a8f03c546487483e6b44.zip jemalloc-3363a841ca087947eb42a8f03c546487483e6b44.tar.gz jemalloc-3363a841ca087947eb42a8f03c546487483e6b44.tar.bz2 |
Merge branch 'disable-tls'
Diffstat (limited to 'jemalloc')
-rw-r--r-- | jemalloc/INSTALL | 6 | ||||
-rw-r--r-- | jemalloc/configure.ac | 65 |
2 files changed, 45 insertions, 26 deletions
diff --git a/jemalloc/INSTALL b/jemalloc/INSTALL index 5cccb4e..8d94e17 100644 --- a/jemalloc/INSTALL +++ b/jemalloc/INSTALL @@ -89,6 +89,12 @@ any of the following arguments (not a definitive list) to 'configure': practice, this feature usually has little impact on performance unless thread-specific caching is disabled. +--disable-tls + Disable thread-local storage (TLS), which allows for fast access to + thread-local variables via the __thread keyword. If TLS is available, + jemalloc uses it for several purposes. Not that disabling TLS implies + --disable-tcache. + The following environment variables (not a definitive list) impact configure's behavior: diff --git a/jemalloc/configure.ac b/jemalloc/configure.ac index f37c2e8..f622682 100644 --- a/jemalloc/configure.ac +++ b/jemalloc/configure.ac @@ -223,7 +223,7 @@ AC_SUBST([RPATH_EXTRA]) dnl Disable rules that do automatic regeneration of configure output by default. AC_ARG_ENABLE([autogen], - [AS_HELP_STRING[--enable-autogen], [Automatically regenerate configure output])], + [AS_HELP_STRING([--enable-autogen], [Automatically regenerate configure output])], if test "x$enable_autogen" = "xno" ; then enable_autogen="0" else @@ -548,6 +548,37 @@ AC_CHECK_LIB([pthread], [pthread_create], [LIBS="$LIBS -lpthread"], CPPFLAGS="$CPPFLAGS -D_REENTRANT" +dnl Enable lazy locking by default. +AC_ARG_ENABLE([lazy_lock], + [AS_HELP_STRING([--disable-lazy-lock], + [Disable lazy locking (always lock, even when single-threaded)])], +[if test "x$enable_lazy_lock" = "xno" ; then + enable_lazy_lock="0" +else + enable_lazy_lock="1" +fi +], +[enable_lazy_lock="1"] +) +if test "x$enable_lazy_lock" = "x1" ; then + AC_CHECK_HEADERS([dlfcn.h], , [AC_MSG_ERROR([dlfcn.h is missing])]) + AC_CHECK_LIB([dl], [dlopen], [LIBS="$LIBS -ldl"], + [AC_MSG_ERROR([libdl is missing])]) + AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ]) +fi +AC_SUBST([enable_lazy_lock]) + +AC_ARG_ENABLE([tls], + [AS_HELP_STRING([--disable-tls], [Disable thread-local storage (__thread keyword)])], +if test "x$enable_tls" = "xno" ; then + enable_tls="0" +else + enable_tls="1" +fi +, +enable_tls="1" +) +if test "x${enable_tls}" = "x1" ; then AC_MSG_CHECKING([for TLS]) AC_RUN_IFELSE([AC_LANG_PROGRAM( [[ @@ -557,14 +588,16 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM( return 0; ]])], - AC_MSG_RESULT([yes]) - have_tls="1", + AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]) - have_tls="0" - AC_DEFINE_UNQUOTED([NO_TLS], [ ])) + enable_tls="0") +fi +if test "x${enable_tls}" = "x0" ; then + AC_DEFINE_UNQUOTED([NO_TLS], [ ]) +fi dnl Finish tcache-related definitions, now that TLS configuration is done. -if test "x$have_tls" = "x0" ; then +if test "x$enable_tls" = "x0" ; then enable_tcache="0" fi if test "x$enable_tcache" = "x1" ; then @@ -581,26 +614,6 @@ fi AC_SUBST([roff_tcache]) AC_SUBST([roff_no_tcache]) -dnl Enable lazy locking by default. -AC_ARG_ENABLE([lazy_lock], - [AS_HELP_STRING([--disable-lazy-lock], - [Disable lazy locking (always lock, even when single-threaded)])], -[if test "x$enable_lazy_lock" = "xno" ; then - enable_lazy_lock="0" -else - enable_lazy_lock="1" -fi -], -[enable_lazy_lock="1"] -) -if test "x$enable_lazy_lock" = "x1" ; then - AC_CHECK_HEADERS([dlfcn.h], , [AC_MSG_ERROR([dlfcn.h is missing])]) - AC_CHECK_LIB([dl], [dlopen], [LIBS="$LIBS -ldl"], - [AC_MSG_ERROR([libdl is missing])]) - AC_DEFINE([JEMALLOC_LAZY_LOCK], [ ]) -fi -AC_SUBST([enable_lazy_lock]) - dnl ============================================================================ dnl Configure libgd for mtrgraph. bins="${objroot}bin/jemtr2mtr${install_suffix}" |