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

Unified Diff: base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc

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: Fix a brain****, may even compile now. Created 4 years, 4 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
Index: base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc
diff --git a/base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc b/base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc
index d851f13f1e8a230b8a1c9e2f8941be1ae0728283..7853422726468ac24eef05f55da667115f2d4fc0 100644
--- a/base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc
+++ b/base/allocator/allocator_shim_default_dispatch_to_tcmalloc.cc
@@ -31,15 +31,20 @@ void TCFree(const AllocatorDispatch*, void* address) {
tc_free(address);
}
+size_t TCGetSizeEstimate(const AllocatorDispatch*, void* address) {
+ return tc_malloc_size(address);
+}
+
} // namespace
const AllocatorDispatch AllocatorDispatch::default_dispatch = {
- &TCMalloc, /* alloc_function */
- &TCCalloc, /* alloc_zero_initialized_function */
- &TCMemalign, /* alloc_aligned_function */
- &TCRealloc, /* realloc_function */
- &TCFree, /* free_function */
- nullptr, /* next */
+ &TCMalloc, /* alloc_function */
+ &TCCalloc, /* alloc_zero_initialized_function */
+ &TCMemalign, /* alloc_aligned_function */
+ &TCRealloc, /* realloc_function */
+ &TCFree, /* free_function */
+ &TCGetSizeEstimate, /* get_size_estimate_function */
+ nullptr, /* next */
};
// In the case of tcmalloc we have also to route the diagnostic symbols,

Powered by Google App Engine
This is Rietveld 408576698