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

Unified Diff: base/metrics/persistent_memory_allocator.h

Issue 2709113003: Clear memory in a predictable and atomic manner when changing type. (Closed)
Patch Set: rebased Created 3 years, 9 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 e0ac867578ab47def39781c66c8b3bcc7a8c2f85..b38f284ff4f95c674126813e6a853e99ea36e03b 100644
--- a/base/metrics/persistent_memory_allocator.h
+++ b/base/metrics/persistent_memory_allocator.h
@@ -217,6 +217,9 @@ class BASE_EXPORT PersistentMemoryAllocator {
};
enum : uint32_t {
+ // A value that will match any type when doing lookups.
+ kTypeIdAny = 0x00000000,
+
// A value indicating that the type is in transition. Work is being done
// on the contents to prepare it for a new type to come.
kTypeIdTransitioning = 0xFFFFFFFF,
@@ -400,7 +403,8 @@ class BASE_EXPORT PersistentMemoryAllocator {
// Changing the type doesn't mean the data is compatible with the new type.
// Passing true for |clear| will zero the memory after the type has been
// changed away from |from_type_id| but before it becomes |to_type_id| meaning
- // that it is done in a manner that is thread-safe.
+ // that it is done in a manner that is thread-safe. Memory is guaranteed to
+ // be zeroed atomically by machine-word in a monotonically increasing order.
//
// It will likely be necessary to reconstruct the type before it can be used.
// Changing the type WILL NOT invalidate existing pointers to the data, either
« 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