[PATCH] D59031: [scudo][standalone] Adding a stats class

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 12:46:24 PST 2019


vitalybuka added inline comments.


================
Comment at: lib/scudo/standalone/stats.h:31
+  void add(StatType I, uptr V) {
+    V += atomic_load_relaxed(&StatsArray[I]);
+    atomic_store_relaxed(&StatsArray[I], V);
----------------
cryptoad wrote:
> vitalybuka wrote:
> > If this is per-thread, why do we need atomics?
> > Just to make GlobalStats::get
> Removed atomics.
Oh, I didn't ask to remove.
GlobalStats does LocalStats::get under the locks
but writes also should be under the lock, or atomics as before


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59031/new/

https://reviews.llvm.org/D59031





More information about the llvm-commits mailing list