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

Unified Diff: base/metrics/persistent_memory_allocator.h

Issue 1619983004: Restrict volatile section of block header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | base/metrics/persistent_memory_allocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/metrics/persistent_memory_allocator.h
diff --git a/base/metrics/persistent_memory_allocator.h b/base/metrics/persistent_memory_allocator.h
index 65d5a0eccbe7c26a350d7b7da2c6268aaf49d1d6..5c2c7049da9c10cc408e28b4a70e9a8a7c44652a 100644
--- a/base/metrics/persistent_memory_allocator.h
+++ b/base/metrics/persistent_memory_allocator.h
@@ -249,11 +249,12 @@ class BASE_EXPORT PersistentMemoryAllocator {
// The shared metadata is always located at the top of the memory segment.
// These convenience functions eliminate constant casting of the base
// pointer within the code.
- const volatile SharedMetadata* shared_meta() const {
- return reinterpret_cast<const volatile SharedMetadata*>(mem_base_);
+ const SharedMetadata* shared_meta() const {
+ return reinterpret_cast<const SharedMetadata*>(
+ const_cast<const char*>(mem_base_));
Alexei Svitkine (slow) 2016/02/05 19:31:32 I don't understand why there's a const_cast here?
}
- volatile SharedMetadata* shared_meta() {
- return reinterpret_cast<volatile SharedMetadata*>(mem_base_);
+ SharedMetadata* shared_meta() {
+ return reinterpret_cast<SharedMetadata*>(const_cast<char*>(mem_base_));
}
// Actual method for doing the allocation.
« no previous file with comments | « no previous file | base/metrics/persistent_memory_allocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698