Actually increment the counter when adding rule nodes to the free list.

MozReview-Commit-ID: 1uipYlIF8fv
This commit is contained in:
Bobby Holley 2017-06-16 09:33:06 -07:00
parent 81275234aa
commit 65fc5a9bd5

View file

@ -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`.