зеркало из https://github.com/mozilla/gecko-dev.git
078c8d1896
In bug 1361258, we unified the initialization sequence on mac, and chose to make the zone registration happen after jemalloc initialization. The order between jemalloc init and zone registration shouldn't actually matter, because jemalloc initializes the first time the allocator is actually used. On the other hand, in some build setups (e.g. with light optimization), the initialization of the thread_arena thread local variable can happen after the forced jemalloc initialization because of the order the corresponding static initializers run. In some levels of optimization, the thread_arena initializer resets the value the jemalloc initialization has set, which subsequently makes choose_arena() return a bogus value (or hit an assertion in ThreadLocal.h on debug builds). So instead of initializing jemalloc from a static initializer, which then registers the zone, we instead register the zone and let jemalloc initialize itself when used, which increases the chances of the thread_arena initializer running first. --HG-- extra : rebase_source : 4d9a5340d097ac8528dc4aaaf0c05bbef40b59bb |
||
---|---|---|
.. | ||
Makefile.in | ||
malloc_decls.h | ||
moz.build | ||
mozjemalloc.cpp | ||
mozjemalloc.h | ||
mozjemalloc_types.h | ||
mozmemory.h | ||
mozmemory_wrap.cpp | ||
mozmemory_wrap.h | ||
rb.h | ||
replace_malloc.h | ||
replace_malloc_bridge.h | ||
zone.c |