aboutsummaryrefslogtreecommitdiff
path: root/libc/malloc_hooks/malloc_hooks.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove gMallocLeakZygoteChild.Christopher Ferris2019-04-161-2/+2
| | | | | | | | | | | | | | | Remove this global variable and change the setting of it to non-zero to a call to android_mallopt. In addition, change the initialize function to use pass a bool* instead of int*. Bug: 130028357 Test: Ran malloc_debug/malloc_hooks/perfetto tests. Change-Id: I20d382bdeaaf38aac6b9dcabea5b3dfab3c945f6 Merged-In: I20d382bdeaaf38aac6b9dcabea5b3dfab3c945f6 (cherry picked from commit 5225b342f0810c027df3d09fbbcef4d324b19b93)
* Refactor the malloc_info code.Christopher Ferris2019-03-051-1/+7
| | | | | | | | | | | | malloc_info needs to be per native allocator, but the code treated it like a global function that doesn't depend on the native memory allocator. Update malloc debug to dump the actual pointers that it has been tracking. Test: bionic-unit-tests pass. Test: malloc debug tests pass. Test: malloc hook tests pass. Change-Id: I3b0d4d748489dd84c16d16933479dc8b8d79013e
* Make aligned_alloc match the standard.Christopher Ferris2019-03-011-1/+1
| | | | | | | | | | | | | | | | Jemalloc does not verify that the size parameter is a multiple of alignment. Fix this since it only went into P. Fix the unit tests, and fix malloc debug/malloc hooks to handle this new restrictive behavior. Bug: 126944692 Test: Ran bionic unit tests. Test: Ran bionic unit tests with malloc hooks enabled (no new tests fail). Test: Ran bionic unit tests with malloc debug enabled (no new tests fail). Test: Ran malloc debug unit tests. Change-Id: I4d50785928815679c781ca729f998454d76b9192
* Fix malloc_hooks for hooks_write_malloc_leak_info.Florian Mayer2018-07-181-0/+5
| | | | Change-Id: I99f9ee0221bc7bbb5e7dd173ae5a6007f0fa871d
* Implement malloc hooks.Christopher Ferris2018-02-131-0/+234
Use the malloc debug framework to implement the malloc debug hooks since it can introduce a performance issue. Also, modify the bionic/tests/utils.h slightly to dump an error message when the exe failed. Bug: 30561479 Test: Ran malloc hook unit tests. Test: Ran malloc debug unit tests. Test: Enabled malloc hooks and ran bionic unit tests and verified no Test: unexpected failures. Test: Enabled malloc debug and malloc hooks and verified malloc debug wins. Test: Enabled malloc debug using env, property, and property with name Test: still works. Change-Id: Ib50046a0493c5c2050cf831befb812310bdcc249 (cherry picked from commit d6a1dc23796696f73f483943534d4c5c4b312d39)