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

Unified Diff: base/trace_event/heap_profiler_allocation_register.h

Issue 1574493002: [Tracing] Add lookup support to AllocationRegister (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/trace_event/heap_profiler_allocation_register.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/heap_profiler_allocation_register.h
diff --git a/base/trace_event/heap_profiler_allocation_register.h b/base/trace_event/heap_profiler_allocation_register.h
index b8afa6b8ed65f76b9dee4e13beeeae57aac93e1f..804be898e4d1d4957d7f394404760fd0c8f96ca5 100644
--- a/base/trace_event/heap_profiler_allocation_register.h
+++ b/base/trace_event/heap_profiler_allocation_register.h
@@ -34,7 +34,7 @@ class BASE_EXPORT AllocationRegister {
// The data stored in the hash table;
// contains the details about an allocation.
struct Allocation {
- void* address;
+ void* const address;
size_t size;
AllocationContext context;
};
@@ -75,6 +75,11 @@ class BASE_EXPORT AllocationRegister {
// with a null pointer.
void Remove(void* address);
+ // Returns a pointer to the allocation at the address, or null if there is no
+ // allocation at that address. This can be used to change the allocation
+ // context after insertion, for example to change the type name.
+ Allocation* Get(void* address);
+
ConstIterator begin() const;
ConstIterator end() const;
« no previous file with comments | « no previous file | base/trace_event/heap_profiler_allocation_register.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698