[lsan] Replace atomic_store/atomic_load with atomic_fetch_add
authorVitaly Buka <vitalybuka@google.com>
Wed, 8 Dec 2021 06:39:12 +0000 (22:39 -0800)
committerVitaly Buka <vitalybuka@google.com>
Wed, 8 Dec 2021 06:39:12 +0000 (22:39 -0800)
compiler-rt/lib/lsan/lsan_common.cpp

index 5319d00..510b4a3 100644 (file)
@@ -913,8 +913,8 @@ uptr LeakReport::ApplySuppressions() {
         leaks_[i].stack_trace_id, StackDepotGet(leaks_[i].stack_trace_id));
     if (s) {
       s->weight += leaks_[i].total_size;
-      atomic_store_relaxed(&s->hit_count, atomic_load_relaxed(&s->hit_count) +
-                                              leaks_[i].hit_count);
+      atomic_fetch_add(&s->hit_count, leaks_[i].hit_count,
+                       memory_order_relaxed);
       leaks_[i].is_suppressed = true;
       ++new_suppressions;
     }