From 65fc5a9bd5e6fd9c8edd4b58f55d1e2e15515f3d Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Fri, 16 Jun 2017 09:33:06 -0700 Subject: [PATCH] Actually increment the counter when adding rule nodes to the free list. MozReview-Commit-ID: 1uipYlIF8fv --- components/style/rule_tree/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index 198999f61b1..30f4d36ab64 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -1339,6 +1339,11 @@ impl Drop for StrongRuleNode { // This can be relaxed since this pointer won't be read until GC. node.next_free.store(old_head, Ordering::Relaxed); + // Increment the free count. This doesn't need to be an RMU atomic + // operation, because the free list is "locked". + let old_free_count = root.free_count.load(Ordering::Relaxed); + root.free_count.store(old_free_count + 1, Ordering::Relaxed); + // This can be release because of the locking of the free list, that // ensures that all the other nodes racing with this one are using // `Acquire`.