Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1642)

Unified Diff: base/metrics/sample_vector.cc

Issue 23450016: Re-land https://codereview.chromium.org/23602005: Use nobarrier atomics for lossy counters in base:… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/metrics/histogram_samples.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/sample_vector.cc
===================================================================
--- base/metrics/sample_vector.cc (revision 221170)
+++ base/metrics/sample_vector.cc (working copy)
@@ -24,7 +24,8 @@
void SampleVector::Accumulate(Sample value, Count count) {
size_t bucket_index = GetBucketIndex(value);
- counts_[bucket_index] += count;
+ subtle::NoBarrier_Store(&counts_[bucket_index],
+ subtle::NoBarrier_Load(&counts_[bucket_index]) + count);
IncreaseSum(count * value);
IncreaseRedundantCount(count);
}
« no previous file with comments | « base/metrics/histogram_samples.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698