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

Unified Diff: base/allocator/allocator_shim.h

Issue 2163783003: Implement a ScopedThreadHeapUsage class to allow profiling per-thread heap usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shim-default
Patch Set: Address Nico's comments. Created 4 years, 3 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 | « base/BUILD.gn ('k') | base/allocator/allocator_shim_default_dispatch_to_glibc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/allocator/allocator_shim.h
diff --git a/base/allocator/allocator_shim.h b/base/allocator/allocator_shim.h
index f1a1e3d7ce0386361480f285cc24f206aee27ac5..aca13d2bcbc554c73eed30f0009cf7432c902c80 100644
--- a/base/allocator/allocator_shim.h
+++ b/base/allocator/allocator_shim.h
@@ -56,12 +56,19 @@ struct AllocatorDispatch {
void* address,
size_t size);
using FreeFn = void(const AllocatorDispatch* self, void* address);
+ // Returns the best available estimate for the actual amount of memory
+ // consumed by the allocation |address|. If possible, this should include
+ // heap overhead or at least a decent estimate of the full cost of the
+ // allocation. If no good estimate is possible, returns zero.
+ using GetSizeEstimateFn = size_t(const AllocatorDispatch* self,
+ void* address);
AllocFn* const alloc_function;
AllocZeroInitializedFn* const alloc_zero_initialized_function;
AllocAlignedFn* const alloc_aligned_function;
ReallocFn* const realloc_function;
FreeFn* const free_function;
+ GetSizeEstimateFn* const get_size_estimate_function;
const AllocatorDispatch* next;
« no previous file with comments | « base/BUILD.gn ('k') | base/allocator/allocator_shim_default_dispatch_to_glibc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698