[PATCH] D59031: [scudo][standalone] Adding a stats class
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 6 11:33:34 PST 2019
vitalybuka accepted this revision.
vitalybuka added inline comments.
This revision is now accepted and ready to land.
================
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);
----------------
If this is per-thread, why do we need atomics?
Just to make GlobalStats::get
================
Comment at: lib/scudo/standalone/stats.h:40
+
+ void set(StatType I, uptr V) { atomic_store_relaxed(&StatsArray[I], V); }
+
----------------
set() is unused?
================
Comment at: lib/scudo/standalone/stats.h:79
+
+ void get(StatCounters S) const {
+ memset(S, 0, StatCount * sizeof(uptr));
----------------
"void get(uptr* S) const" would make it more readable
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