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

Unified Diff: base/metrics/persistent_memory_allocator.h

Issue 2534643002: Add support for turning pointers back to references. (Closed)
Patch Set: added underflow check Created 4 years, 1 month 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 de3293b9590d133157ec6e903eb7387d9d42aa83..ab9dd9d5eff2ea66603dd92ece6edbfe5871d5de 100644
--- a/base/metrics/persistent_memory_allocator.h
+++ b/base/metrics/persistent_memory_allocator.h
@@ -316,6 +316,11 @@ class BASE_EXPORT PersistentMemoryAllocator {
GetBlockData(ref, type_id, count * sizeof(T))));
}
+ // Get the corresponding reference for an object held in persistent memory.
+ // If the |memory| is not valid or the type does not match, a kReferenceNull
+ // result will be returned.
+ Reference GetAsReference(const void* memory, uint32_t type_id) const;
+
// Get the number of bytes allocated to a block. This is useful when storing
// arrays in order to validate the ending boundary. The returned value will
// include any padding added to achieve the required alignment and so could
« 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