Bug 1153683 - mozjemalloc: unbreak NO_TLS for other POSIX platforms.
MozReview-Commit-ID: K2Ng49LDypC
--- a/memory/mozjemalloc/jemalloc.c
+++ b/memory/mozjemalloc/jemalloc.c
@@ -97,17 +97,16 @@
* Huge : Each allocation is backed by a dedicated contiguous set of chunks.
* Metadata are stored in a separate red-black tree.
*
*******************************************************************************
*/
#ifdef MOZ_MEMORY_ANDROID
#define NO_TLS
-#define _pthread_self() pthread_self()
#endif
/*
* On Linux, we use madvise(MADV_DONTNEED) to release memory back to the
* operating system. If we release 1MB of live pages with MADV_DONTNEED, our
* RSS will decrease by 1MB (almost) immediately.
*
* On Mac, we use madvise(MADV_FREE). Unlike MADV_DONTNEED on Linux, MADV_FREE
@@ -1303,16 +1302,20 @@ static pthread_mutex_t arenas_lock; /* P
#ifndef NO_TLS
/*
* Map of pthread_self() --> arenas[???], used for selecting an arena to use
* for allocations.
*/
#ifndef MOZ_MEMORY_WINDOWS
static __thread arena_t *arenas_map;
#endif
+#else
+#ifndef _pthread_self
+#define _pthread_self() pthread_self()
+#endif
#endif
/*******************************/
/*
* Runtime configuration options.
*/
MOZ_JEMALLOC_API
const char *_malloc_options = MOZ_MALLOC_OPTIONS;