mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Auto merge of #15562 - emilio:rule-mem-order, r=bholley
style: Tweak rule tree memory ordering. I've commented on the ones that I think are the most tricky. Note that this code is stress-tested in the style tests (tests/unit/style/rule_tree/bench.rs). <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15562) <!-- Reviewable:end -->
This commit is contained in:
commit
dc8ed0d740
2 changed files with 80 additions and 41 deletions
|
@ -32,7 +32,12 @@ impl<'a> AutoGCRuleTree<'a> {
|
|||
|
||||
impl<'a> Drop for AutoGCRuleTree<'a> {
|
||||
fn drop(&mut self) {
|
||||
unsafe { self.0.gc() }
|
||||
unsafe {
|
||||
self.0.gc();
|
||||
assert!(::std::thread::panicking() ||
|
||||
!self.0.root().has_children_for_testing(),
|
||||
"No rule nodes other than the root shall remain!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue