Chromium Code Reviews| Index: base/allocator/allocator_shim.h |
| diff --git a/base/allocator/allocator_shim.h b/base/allocator/allocator_shim.h |
| index 8fd060fca6aaeee76a74cdd613af09579a56b77d..2595b1fce09a74ef9da152e43f08aa5ae1ec71d4 100644 |
| --- a/base/allocator/allocator_shim.h |
| +++ b/base/allocator/allocator_shim.h |
| @@ -8,6 +8,7 @@ |
| #include <stddef.h> |
| #include "base/base_export.h" |
| +#include "build/build_config.h" |
| namespace base { |
| namespace allocator { |
| @@ -62,6 +63,13 @@ struct AllocatorDispatch { |
| // allocation. If no good estimate is possible, returns zero. |
| using GetSizeEstimateFn = size_t(const AllocatorDispatch* self, |
| void* address); |
| + using BatchMallocFn = unsigned(const AllocatorDispatch* self, |
| + size_t size, |
| + void** results, |
| + unsigned num_requested); |
| + using BatchFreeFn = void(const AllocatorDispatch* self, |
| + void** to_be_freed, |
| + unsigned num_to_be_freed); |
| AllocFn* const alloc_function; |
| AllocZeroInitializedFn* const alloc_zero_initialized_function; |
| @@ -69,6 +77,8 @@ struct AllocatorDispatch { |
| ReallocFn* const realloc_function; |
| FreeFn* const free_function; |
| GetSizeEstimateFn* const get_size_estimate_function; |
| + BatchMallocFn* const batch_malloc_function; |
| + BatchFreeFn* const batch_free_function; |
| const AllocatorDispatch* next; |
| @@ -97,6 +107,11 @@ BASE_EXPORT void InsertAllocatorDispatch(AllocatorDispatch* dispatch); |
| // in malloc(), which we really don't want. |
| BASE_EXPORT void RemoveAllocatorDispatchForTesting(AllocatorDispatch* dispatch); |
| +#if defined(OS_MACOSX) |
|
Primiano Tucci (use gerrit)
2017/01/28 05:10:02
Was this the argument of the discussion with dskib
erikchen
2017/01/31 02:21:22
No, the discussion was about whether the members b
|
| +// On macOS, the allocator shim needs to be turned on during runtime. |
| +BASE_EXPORT void InitializeAllocatorShim(); |
| +#endif // defined(OS_MACOSX) |
| + |
| } // namespace allocator |
| } // namespace base |