From 6818cdb2491ed0c7d88af2e89ab3ad32bc6a24e0 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Thu, 11 May 2017 12:01:41 +0900 Subject: [PATCH] Bug 1361258 - Opt-in to thread-local jemalloc arenas for stylo rayon threads. r=bholley --- components/style/gecko/global_style_data.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/style/gecko/global_style_data.rs b/components/style/gecko/global_style_data.rs index b1f62b0eac0..3cbace9b90a 100644 --- a/components/style/gecko/global_style_data.rs +++ b/components/style/gecko/global_style_data.rs @@ -6,6 +6,7 @@ use context::StyleSystemOptions; use gecko_bindings::bindings::{Gecko_RegisterProfilerThread, Gecko_UnregisterProfilerThread}; +use gecko_bindings::bindings::Gecko_SetJemallocThreadLocalArena; use num_cpus; use rayon; use shared_lock::SharedRwLock; @@ -33,6 +34,9 @@ fn thread_name(index: usize) -> String { } fn thread_startup(index: usize) { + unsafe { + Gecko_SetJemallocThreadLocalArena(true); + } let name = thread_name(index); let name = CString::new(name).unwrap(); unsafe { @@ -44,6 +48,7 @@ fn thread_startup(index: usize) { fn thread_shutdown(_: usize) { unsafe { Gecko_UnregisterProfilerThread(); + Gecko_SetJemallocThreadLocalArena(false); } }