Chromium Code Reviews| Index: base/trace_event/malloc_dump_provider.cc |
| diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc |
| index 3b1a933bce56f8154f7871434f8cf692b02b3267..cc218341ed7d8d5ec5ae9c5bf49e209cd91427d6 100644 |
| --- a/base/trace_event/malloc_dump_provider.cc |
| +++ b/base/trace_event/malloc_dump_provider.cc |
| @@ -27,6 +27,7 @@ namespace base { |
| namespace trace_event { |
| #if BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM) |
| + |
| namespace { |
| using allocator::AllocatorDispatch; |
| @@ -73,13 +74,21 @@ void HookFree(const AllocatorDispatch* self, void* address) { |
| next->free_function(next, address); |
| } |
| +size_t HookGetSizeEstimate(const AllocatorDispatch* self, void* address) { |
|
Primiano Tucci (use gerrit)
2016/08/24 14:11:46
yeah you don't really need to touch this at all if
Sigurður Ásgeirsson
2016/09/01 15:18:18
Acknowledged.
|
| + const AllocatorDispatch* const next = self->next; |
| + if (!next->get_size_estimate_function) |
| + return 0; |
| + return next->get_size_estimate_function(next, address); |
| +} |
| + |
| AllocatorDispatch g_allocator_hooks = { |
| - &HookAlloc, /* alloc_function */ |
| - &HookZeroInitAlloc, /* alloc_zero_initialized_function */ |
| - &HookllocAligned, /* alloc_aligned_function */ |
| - &HookRealloc, /* realloc_function */ |
| - &HookFree, /* free_function */ |
| - nullptr, /* next */ |
| + &HookAlloc, /* alloc_function */ |
| + &HookZeroInitAlloc, /* alloc_zero_initialized_function */ |
| + &HookllocAligned, /* alloc_aligned_function */ |
| + &HookRealloc, /* realloc_function */ |
| + &HookFree, /* free_function */ |
| + &HookGetSizeEstimate, /* get_size_estimate_function */ |
| + nullptr, /* next */ |
| }; |
| } // namespace |