summaryrefslogtreecommitdiffstats
path: root/jemalloc
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2010-01-17 22:06:20 (GMT)
committerJason Evans <jasone@canonware.com>2010-01-17 22:06:20 (GMT)
commit78d815c9deaf7ce665110d7738482421d25b2ff0 (patch)
tree14da03b96dd7cf5a5554c9ef5d737c91588ff41d /jemalloc
parentb0fd5016db74678476868abb380170b319a50480 (diff)
downloadjemalloc-78d815c9deaf7ce665110d7738482421d25b2ff0.zip
jemalloc-78d815c9deaf7ce665110d7738482421d25b2ff0.tar.gz
jemalloc-78d815c9deaf7ce665110d7738482421d25b2ff0.tar.bz2
Add the --disable-tls configure option.
Diffstat (limited to 'jemalloc')
-rw-r--r--jemalloc/INSTALL6
-rw-r--r--jemalloc/configure.ac65
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}"