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 d7732aba664ebf38532d247c562c1df98ebe62e2..0258386deb3e527d93492a95391e425e6775430b 100644 |
| --- a/base/trace_event/malloc_dump_provider.cc |
| +++ b/base/trace_event/malloc_dump_provider.cc |
| @@ -77,13 +77,21 @@ void HookFree(const AllocatorDispatch* self, void* address) { |
| next->free_function(next, address); |
| } |
| +size_t HookGetSizeEstimate(const AllocatorDispatch* self, void* address) { |
| + const AllocatorDispatch* const next = self->next; |
| + if (!next->get_size_estimate_function) |
|
Primiano Tucci (use gerrit)
2016/09/07 17:53:38
not sure we need this level of protection here rig
Sigurður Ásgeirsson
2016/09/07 18:35:35
Done.
|
| + 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 */ |
| }; |
| #endif // BUILDFLAG(USE_EXPERIMENTAL_ALLOCATOR_SHIM) |