summaryrefslogtreecommitdiffstats
path: root/memory/mozjemalloc/jemalloc.c
diff options
context:
space:
mode:
authorOlivier Certner <olce.palemoon@certner.fr>2021-01-07 20:28:40 +0100
committerOlivier Certner <olce.palemoon@certner.fr>2021-01-07 20:28:40 +0100
commit5d95844f496166ee54838796c013d7ee5a1ec6ce (patch)
tree5ca810039497740dcba678859e5b562b63dfc09c /memory/mozjemalloc/jemalloc.c
parent3e2dcaf7f20dbe3f92f65fbdfbeb3b8ab83df7a2 (diff)
downloadUXP-5d95844f496166ee54838796c013d7ee5a1ec6ce.tar
UXP-5d95844f496166ee54838796c013d7ee5a1ec6ce.tar.gz
UXP-5d95844f496166ee54838796c013d7ee5a1ec6ce.tar.lz
UXP-5d95844f496166ee54838796c013d7ee5a1ec6ce.tar.xz
UXP-5d95844f496166ee54838796c013d7ee5a1ec6ce.zip
Revert "Issue #1699 - Part 3a: mozjemalloc: Memory barriers on 'malloc_initialized'"
This reverts commit f76695c1ce032b634f3e0e2a593aebdd1d49703b. SUSv4 specifies that 'pthread_create' acts as a (full) memory barrier, so barriers here are not necessary.
Diffstat (limited to 'memory/mozjemalloc/jemalloc.c')
-rw-r--r--memory/mozjemalloc/jemalloc.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c
index 494e82099..bbd68365b 100644
--- a/memory/mozjemalloc/jemalloc.c
+++ b/memory/mozjemalloc/jemalloc.c
@@ -4758,7 +4758,7 @@ huge_dalloc(void *ptr)
base_node_dealloc(node);
}
-/*
+/*
* Platform-specific methods to determine the number of CPUs in a system.
* This will be used to determine the desired number of arenas.
*/
@@ -4845,7 +4845,7 @@ static inline unsigned
malloc_ncpus(void)
{
SYSTEM_INFO info;
-
+
GetSystemInfo(&info);
return (info.dwNumberOfProcessors);
}
@@ -5246,7 +5246,6 @@ malloc_init_hard(void)
malloc_mutex_lock(&init_lock);
#endif
-#ifndef __FreeBSD__
if (malloc_initialized) {
/*
* Another thread initialized the allocator before this one
@@ -5257,11 +5256,6 @@ malloc_init_hard(void)
#endif
return (false);
}
-#else
- if (__atomic_load_n(&malloc_initialized, __ATOMIC_ACQUIRE)) {
- return (false);
- }
-#endif
#ifdef MOZ_MEMORY_WINDOWS
/* get a thread local storage index */
@@ -5687,11 +5681,7 @@ MALLOC_OUT:
if (chunk_rtree == NULL)
return (true);
-#ifndef __FreeBSD__
malloc_initialized = true;
-#else
- __atomic_store_n(&malloc_initialized, true, __ATOMIC_RELEASE);
-#endif
#if !defined(MOZ_MEMORY_WINDOWS) && !defined(MOZ_MEMORY_DARWIN)
/* Prevent potential deadlock on malloc locks after fork. */