mirror of
https://github.com/servo/servo.git
synced 2025-08-14 18:05:36 +01:00
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).
This commit is contained in:
parent
5b037a0aa0
commit
1d94a68e54
2 changed files with 80 additions and 41 deletions
|
@ -33,7 +33,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