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, |