summaryrefslogtreecommitdiffstats
path: root/memory/mozjemalloc
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2020-02-23 00:26:22 -0500
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-14 12:53:27 +0200
commitec2daa8dc96bfc275b1d13a7ac880940f506f71e (patch)
tree401d750381d6cb45082d885a72f75c50e0c74ba5 /memory/mozjemalloc
parent44c169c9be3cec6957d5b04272a3564cf9137109 (diff)
downloadUXP-ec2daa8dc96bfc275b1d13a7ac880940f506f71e.tar
UXP-ec2daa8dc96bfc275b1d13a7ac880940f506f71e.tar.gz
UXP-ec2daa8dc96bfc275b1d13a7ac880940f506f71e.tar.lz
UXP-ec2daa8dc96bfc275b1d13a7ac880940f506f71e.tar.xz
UXP-ec2daa8dc96bfc275b1d13a7ac880940f506f71e.zip
Issue #1053 - Remove android support from memory
Diffstat (limited to 'memory/mozjemalloc')
-rw-r--r--memory/mozjemalloc/jemalloc.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c
index ecc9d2985..50ba22889 100644
--- a/memory/mozjemalloc/jemalloc.c
+++ b/memory/mozjemalloc/jemalloc.c
@@ -100,11 +100,6 @@
*******************************************************************************
*/
-#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
@@ -174,7 +169,7 @@
# define MALLOC_SYSV
#endif
-#if defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID)
+#ifdef MOZ_MEMORY_LINUX
#define _GNU_SOURCE /* For mremap(2). */
#endif
@@ -498,7 +493,7 @@ static bool malloc_initialized = false;
/* No init lock for Windows. */
#elif defined(MOZ_MEMORY_DARWIN)
static malloc_mutex_t init_lock = {OS_SPINLOCK_INIT};
-#elif defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID)
+#elif defined(MOZ_MEMORY_LINUX)
static malloc_mutex_t init_lock = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
#else
static malloc_mutex_t init_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -1374,12 +1369,6 @@ void (*_malloc_message)(const char *p1, const char *p2, const char *p3,
# define assert(e)
#endif
-#ifdef MOZ_MEMORY_ANDROID
-// Android's pthread.h does not declare pthread_atfork() until SDK 21.
-extern MOZ_EXPORT
-int pthread_atfork(void (*)(void), void (*)(void), void(*)(void));
-#endif
-
#if defined(MOZ_JEMALLOC_HARD_ASSERTS)
# define RELEASE_ASSERT(assertion) do { \
if (!(assertion)) { \
@@ -1404,7 +1393,7 @@ malloc_mutex_init(malloc_mutex_t *mutex)
InitializeSRWLock(mutex);
#elif defined(MOZ_MEMORY_DARWIN)
mutex->lock = OS_SPINLOCK_INIT;
-#elif defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID)
+#elif defined(MOZ_MEMORY_LINUX)
pthread_mutexattr_t attr;
if (pthread_mutexattr_init(&attr) != 0)
return (true);
@@ -1457,7 +1446,7 @@ malloc_spin_init(malloc_spinlock_t *lock)
InitializeSRWLock(lock);
#elif defined(MOZ_MEMORY_DARWIN)
lock->lock = OS_SPINLOCK_INIT;
-#elif defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID)
+#elif defined(MOZ_MEMORY_LINUX)
pthread_mutexattr_t attr;
if (pthread_mutexattr_init(&attr) != 0)
return (true);