Invert NO_TLS to JEMALLOC_TLS.

This commit is contained in:
Jason Evans
2012-03-19 10:21:17 -07:00
parent f3e139a1ef
commit e24c7af35d
9 changed files with 28 additions and 28 deletions

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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

View File

@@ -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