Bug 1418104 - Initialize the allocator in jemalloc_stats. r=njn

Some unit tests rely on jemalloc_stats to get information such as chunk
size or page size. They can do so before any allocation happens, when
using gtest filters. So it is preferable for jemalloc_stats to
initialize the allocator.

--HG--
extra : rebase_source : 6696ec1cdaa3b121a3d12cb7b6049b79c656d271
This commit is contained in:
Mike Hommey 2017-11-16 16:35:03 +09:00
parent 818f7e1ab6
commit c4587b9a17

View File

@ -4470,7 +4470,7 @@ MozJemalloc::jemalloc_stats(jemalloc_stats_t* aStats)
if (!aStats) {
return;
}
if (!malloc_initialized) {
if (!malloc_init()) {
memset(aStats, 0, sizeof(*aStats));
return;
}