GC the rule tree only when the free list gets to a certain size.

This commit is contained in:
Cameron McCormack 2016-11-17 16:24:58 +08:00
parent 181208a4e4
commit 4e52bb49b9
2 changed files with 34 additions and 7 deletions

View file

@ -1180,11 +1180,8 @@ impl LayoutThread {
shared_layout_context.style_context.stylist.rule_tree.dump_stdout();
}
// GC The rule tree.
//
// FIXME(emilio): The whole point of the free list is not always freeing
// the list, find a good heuristic here for that.
unsafe { shared_layout_context.style_context.stylist.rule_tree.gc() }
// GC the rule tree if some heuristics are met.
unsafe { shared_layout_context.style_context.stylist.rule_tree.maybe_gc(); }
// Perform post-style recalculation layout passes.
self.perform_post_style_recalc_layout_passes(&data.reflow_info,