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

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 12:17:49 PST 2019


cryptoad 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);
----------------
vitalybuka wrote:
> If this is per-thread, why do we need atomics?
> Just to make GlobalStats::get
Removed atomics.


================
Comment at: lib/scudo/standalone/stats.h:40
+
+  void set(StatType I, uptr V) { atomic_store_relaxed(&StatsArray[I], V); }
+
----------------
vitalybuka wrote:
> set() is unused?
I am just using it in tests.


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