Chromium Code Reviews
Descriptionmac: Hook up allocator shim.
This CL is based on dskiba's CL at https://codereview.chromium.org/2499373003/#.
This CL makes several changes:
* Hooks into C/C++ heap allocations so that they go through base/allocator.
This brings macOS into parity with the other platforms.
* Add two new functions to AllocatorDispatch: BatchMallocFn and BatchFreeFn.
On macOS, there is an additional abstraction layer called malloc zones. This CL
only hooks the default malloc zone, which appears to be responsible for most
allocations. There is no good mechanism [short of interposition] to determine
when new malloc zones are added, so there's no clean mechanism of hooking all
zones. Plus we would have to rework the allocator shim abstraction.
BUG=665567
Patch Set 1 #Patch Set 2 : more plumbing. #Patch Set 3 : compile error. #Patch Set 4 : Symbol visibility, cleanup. #Patch Set 5 : add comment #Patch Set 6 : Add plumbing. #Patch Set 7 : clang format #Patch Set 8 : Fix test. #Patch Set 9 : More tests. #Patch Set 10 : Fix const correctness. #Patch Set 11 : more const void* fixes. #Patch Set 12 : Undo const correctness change. #Patch Set 13 : use __attribute__((constructor)). #Patch Set 14 : Refactor. #Patch Set 15 : Clean up. #
Total comments: 7
Dependent Patchsets: Messages
Total messages: 69 (62 generated)
|