Chromium Code Reviews| 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. |