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:
Emilio Cobos Álvarez 2017-02-15 13:29:29 +01:00
parent 5b037a0aa0
commit 1d94a68e54
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 80 additions and 41 deletions

View file

@ -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!");
}
}
}