diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index c365ff677a1..13fe500e0c4 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -250,16 +250,16 @@ pub type RawServoSupportsRuleBorrowed<'a> = &'a RawServoSupportsRule; pub type RawServoSupportsRuleBorrowedOrNull<'a> = Option<&'a RawServoSupportsRule>; enum RawServoSupportsRuleVoid { } pub struct RawServoSupportsRule(RawServoSupportsRuleVoid); -pub type RawServoRuleNodeStrong = ::gecko_bindings::sugar::ownership::Strong; -pub type RawServoRuleNodeBorrowed<'a> = &'a RawServoRuleNode; -pub type RawServoRuleNodeBorrowedOrNull<'a> = Option<&'a RawServoRuleNode>; -enum RawServoRuleNodeVoid { } -pub struct RawServoRuleNode(RawServoRuleNodeVoid); pub type RawServoDocumentRuleStrong = ::gecko_bindings::sugar::ownership::Strong; pub type RawServoDocumentRuleBorrowed<'a> = &'a RawServoDocumentRule; pub type RawServoDocumentRuleBorrowedOrNull<'a> = Option<&'a RawServoDocumentRule>; enum RawServoDocumentRuleVoid { } pub struct RawServoDocumentRule(RawServoDocumentRuleVoid); +pub type RawServoRuleNodeStrong = ::gecko_bindings::sugar::ownership::Strong; +pub type RawServoRuleNodeBorrowed<'a> = &'a RawServoRuleNode; +pub type RawServoRuleNodeBorrowedOrNull<'a> = Option<&'a RawServoRuleNode>; +enum RawServoRuleNodeVoid { } +pub struct RawServoRuleNode(RawServoRuleNodeVoid); pub type RawServoStyleSetOwned = ::gecko_bindings::sugar::ownership::Owned; pub type RawServoStyleSetOwnedOrNull = ::gecko_bindings::sugar::ownership::OwnedOrNull; pub type RawServoStyleSetBorrowed<'a> = &'a RawServoStyleSet; @@ -421,18 +421,18 @@ extern "C" { extern "C" { pub fn Servo_SupportsRule_Release(ptr: RawServoSupportsRuleBorrowed); } -extern "C" { - pub fn Servo_RuleNode_AddRef(ptr: RawServoRuleNodeBorrowed); -} -extern "C" { - pub fn Servo_RuleNode_Release(ptr: RawServoRuleNodeBorrowed); -} extern "C" { pub fn Servo_DocumentRule_AddRef(ptr: RawServoDocumentRuleBorrowed); } extern "C" { pub fn Servo_DocumentRule_Release(ptr: RawServoDocumentRuleBorrowed); } +extern "C" { + pub fn Servo_RuleNode_AddRef(ptr: RawServoRuleNodeBorrowed); +} +extern "C" { + pub fn Servo_RuleNode_Release(ptr: RawServoRuleNodeBorrowed); +} extern "C" { pub fn Servo_StyleSet_Drop(ptr: RawServoStyleSetOwned); } @@ -1587,6 +1587,9 @@ extern "C" { URLMatchingFunction) -> bool; } +extern "C" { + pub fn Gecko_SetJemallocThreadLocalArena(enabled: bool); +} extern "C" { pub fn Servo_Element_ClearData(node: RawGeckoElementBorrowed); } 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); } }