From a3b32aaa5baa12567d7e9fc144d930327dc9c956 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Fri, 16 Jun 2017 10:20:25 -0700 Subject: [PATCH] Trigger a rule tree gc at the end of DoProcessPendingRestyles. MozReview-Commit-ID: W2lkQohudA --- ports/geckolib/glue.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 2b973124977c..96577b345466 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -303,6 +303,16 @@ pub extern "C" fn Servo_TraverseSubtree(root: RawGeckoElementBorrowed, element.has_dirty_descendants() || element.borrow_data().unwrap().restyle.contains_restyle_data() } +/// Checks whether the rule tree has crossed its threshold for unused nodes, and +/// if so, frees them. +#[no_mangle] +pub extern "C" fn Servo_MaybeGCRuleTree(raw_data: RawServoStyleSetBorrowed) { + let per_doc_data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); + unsafe { + per_doc_data.stylist.rule_tree().maybe_gc(); + } +} + #[no_mangle] pub extern "C" fn Servo_AnimationValues_Interpolate(from: RawServoAnimationValueBorrowed, to: RawServoAnimationValueBorrowed,