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

Unified Diff: base/metrics/persistent_histogram_allocator.cc

Issue 2699953002: Add acquire/release to global variable. (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/persistent_histogram_allocator.cc
diff --git a/base/metrics/persistent_histogram_allocator.cc b/base/metrics/persistent_histogram_allocator.cc
index 3849cbc36b4590a7c9fea2680a985da71852dfdb..67af4a0224031e8f84e40b0028c28e5452d97320 100644
--- a/base/metrics/persistent_histogram_allocator.cc
+++ b/base/metrics/persistent_histogram_allocator.cc
@@ -823,8 +823,8 @@ void GlobalHistogramAllocator::Set(
// likely has histograms stored within it. If the backing memory is also
// also released, future accesses to those histograms will seg-fault.
CHECK(!subtle::NoBarrier_Load(&g_allocator));
- subtle::NoBarrier_Store(&g_allocator,
- reinterpret_cast<uintptr_t>(allocator.release()));
+ subtle::Release_Store(&g_allocator,
+ reinterpret_cast<uintptr_t>(allocator.release()));
size_t existing = StatisticsRecorder::GetHistogramCount();
DVLOG_IF(1, existing)
@@ -834,7 +834,7 @@ void GlobalHistogramAllocator::Set(
// static
GlobalHistogramAllocator* GlobalHistogramAllocator::Get() {
return reinterpret_cast<GlobalHistogramAllocator*>(
- subtle::NoBarrier_Load(&g_allocator));
+ subtle::Acquire_Load(&g_allocator));
}
// static
@@ -864,7 +864,7 @@ GlobalHistogramAllocator::ReleaseForTesting() {
DCHECK_NE(kResultHistogram, data->name);
}
- subtle::NoBarrier_Store(&g_allocator, 0);
+ subtle::Release_Store(&g_allocator, 0);
return WrapUnique(histogram_allocator);
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698