summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Evans <je@fb.com>2012-03-19 17:21:17 (GMT)
committerJason Evans <je@fb.com>2012-03-19 17:21:17 (GMT)
commite24c7af35d1e9d24d02166ac98cfca7cf807ff13 (patch)
treef25631edca6a50dd84546f902b793146ad986a84 /src
parentf3e139a1ef17f300ebed0577a0ee7b3714404707 (diff)
downloadjemalloc-e24c7af35d1e9d24d02166ac98cfca7cf807ff13.zip
jemalloc-e24c7af35d1e9d24d02166ac98cfca7cf807ff13.tar.gz
jemalloc-e24c7af35d1e9d24d02166ac98cfca7cf807ff13.tar.bz2
Invert NO_TLS to JEMALLOC_TLS.
Diffstat (limited to 'src')
-rw-r--r--src/chunk_mmap.c4
-rw-r--r--src/jemalloc.c10
-rw-r--r--src/prof.c2
-rw-r--r--src/tcache.c2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/chunk_mmap.c b/src/chunk_mmap.c
index c740928..6ea2118 100644
--- a/src/chunk_mmap.c
+++ b/src/chunk_mmap.c
@@ -8,7 +8,7 @@
* Used by chunk_alloc_mmap() to decide whether to attempt the fast path and
* potentially avoid some system calls.
*/
-#ifndef NO_TLS
+#ifdef JEMALLOC_TLS
static __thread bool mmap_unaligned_tls
JEMALLOC_ATTR(tls_model("initial-exec"));
#define MMAP_UNALIGNED_GET() mmap_unaligned_tls
@@ -225,7 +225,7 @@ bool
chunk_mmap_boot(void)
{
-#ifdef NO_TLS
+#ifndef JEMALLOC_TLS
if (pthread_key_create(&mmap_unaligned_tsd, NULL) != 0) {
malloc_write("<jemalloc>: Error in pthread_key_create()\n");
return (true);
diff --git a/src/jemalloc.c b/src/jemalloc.c
index 385eb03..e2b6134 100644
--- a/src/jemalloc.c
+++ b/src/jemalloc.c
@@ -9,11 +9,11 @@ arena_t **arenas;
unsigned narenas;
pthread_key_t arenas_tsd;
-#ifndef NO_TLS
+#ifdef JEMALLOC_TLS
__thread arena_t *arenas_tls JEMALLOC_ATTR(tls_model("initial-exec"));
#endif
-#ifndef NO_TLS
+#ifdef JEMALLOC_TLS
__thread thread_allocated_t thread_allocated_tls;
#endif
pthread_key_t thread_allocated_tsd;
@@ -58,7 +58,7 @@ size_t opt_narenas = 0;
static void stats_print_atexit(void);
static unsigned malloc_ncpus(void);
static void arenas_cleanup(void *arg);
-#ifdef NO_TLS
+#ifndef JEMALLOC_TLS
static void thread_allocated_cleanup(void *arg);
#endif
static bool malloc_conf_next(char const **opts_p, char const **k_p,
@@ -251,7 +251,7 @@ arenas_cleanup(void *arg)
malloc_mutex_unlock(&arenas_lock);
}
-#ifdef NO_TLS
+#ifndef JEMALLOC_TLS
static void
thread_allocated_cleanup(void *arg)
{
@@ -656,7 +656,7 @@ malloc_init_hard(void)
return (true);
}
-#ifdef NO_TLS
+#ifndef JEMALLOC_TLS
/* Initialize allocation counters before any allocations can occur. */
if (config_stats && pthread_key_create(&thread_allocated_tsd,
thread_allocated_cleanup) != 0) {
diff --git a/src/prof.c b/src/prof.c
index 2ca66c7..9c32737 100644
--- a/src/prof.c
+++ b/src/prof.c
@@ -26,7 +26,7 @@ char opt_prof_prefix[PATH_MAX + 1];
uint64_t prof_interval;
bool prof_promote;
-#ifndef NO_TLS
+#ifdef JEMALLOC_TLS
__thread prof_tdata_t *prof_tdata_tls
JEMALLOC_ATTR(tls_model("initial-exec"));
#endif
diff --git a/src/tcache.c b/src/tcache.c
index 478b7f5..f90308c 100644
--- a/src/tcache.c
+++ b/src/tcache.c
@@ -11,7 +11,7 @@ tcache_bin_info_t *tcache_bin_info;
static unsigned stack_nelms; /* Total stack elms per tcache. */
/* Map of thread-specific caches. */
-#ifndef NO_TLS
+#ifdef JEMALLOC_TLS
__thread tcache_t *tcache_tls JEMALLOC_ATTR(tls_model("initial-exec"));
#endif