Backed out changeset 0e349b74bfc6 (bug 1399921) for failure to thrive on Mac

MozReview-Commit-ID: HoBhxzIzn2d
This commit is contained in:
Phil Ringnalda 2017-09-14 20:36:41 -07:00
parent c53e695a6e
commit eab70d0a07
2 changed files with 22 additions and 3 deletions

View File

@ -4370,7 +4370,7 @@ huge_dalloc(void *ptr)
* implementation has to take pains to avoid infinite recursion during
* initialization.
*/
#if defined(XP_WIN)
#if (defined(XP_WIN) || defined(XP_DARWIN))
#define malloc_init() false
#else
static inline bool
@ -4384,6 +4384,10 @@ malloc_init(void)
}
#endif
#if defined(XP_DARWIN)
extern "C" void register_zone(void);
#endif
static size_t
GetKernelPageSize()
{
@ -4648,6 +4652,10 @@ MALLOC_OUT:
pthread_atfork(_malloc_prefork, _malloc_postfork_parent, _malloc_postfork_child);
#endif
#if defined(XP_DARWIN)
register_zone();
#endif
#ifndef XP_WIN
malloc_mutex_unlock(&init_lock);
#endif
@ -5437,6 +5445,18 @@ replace_malloc_init_funcs()
# include <dlfcn.h>
#endif
#if defined(XP_DARWIN)
__attribute__((constructor))
void
jemalloc_darwin_init(void)
{
if (malloc_init_hard())
MOZ_CRASH();
}
#endif
#if defined(__GLIBC__) && !defined(__UCLIBC__)
/*
* glibc provides the RTLD_DEEPBIND flag for dlopen which can make it possible

View File

@ -345,8 +345,7 @@ static malloc_zone_t *get_default_zone()
}
__attribute__((constructor))
static void
void
register_zone(void)
{
malloc_zone_t *default_zone = get_default_zone();