From 996511a45655e452ec3132094e08dcbebee36a67 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Fri, 13 Dec 2019 14:46:10 +0100 Subject: [PATCH] Use 'relaxed' memory ordering for simple atomic counters in dep-graph. --- src/librustc/dep_graph/graph.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/librustc/dep_graph/graph.rs b/src/librustc/dep_graph/graph.rs index 0616f00b8c47..0148997ca9ee 100644 --- a/src/librustc/dep_graph/graph.rs +++ b/src/librustc/dep_graph/graph.rs @@ -497,8 +497,8 @@ impl DepGraph { let current_dep_graph = &self.data.as_ref().unwrap().current; Some(( - current_dep_graph.total_read_count.load(SeqCst), - current_dep_graph.total_duplicate_read_count.load(SeqCst), + current_dep_graph.total_read_count.load(Relaxed), + current_dep_graph.total_duplicate_read_count.load(Relaxed), )) } else { None @@ -1111,7 +1111,7 @@ impl DepGraphData { if let Some(task_deps) = icx.task_deps { let mut task_deps = task_deps.lock(); if cfg!(debug_assertions) { - self.current.total_read_count.fetch_add(1, SeqCst); + self.current.total_read_count.fetch_add(1, Relaxed); } if task_deps.read_set.insert(source) { task_deps.reads.push(source); @@ -1129,7 +1129,7 @@ impl DepGraphData { } } } else if cfg!(debug_assertions) { - self.current.total_duplicate_read_count.fetch_add(1, SeqCst); + self.current.total_duplicate_read_count.fetch_add(1, Relaxed); } } })