summaryrefslogtreecommitdiff
path: root/libc/malloc_hooks/malloc_hooks.cpp
diff options
context:
space:
mode:
authorVic Yang <victoryang@google.com>2018-11-27 13:34:44 -0800
committerVic Yang <victoryang@google.com>2018-11-27 13:34:44 -0800
commitde69660bbdb610b196b2f896045125f4a9809d4e (patch)
tree37f75cbeb2433802e63b3a442a409d2e0375f7b6 /libc/malloc_hooks/malloc_hooks.cpp
parent0ff8df5f6affa4dac7658e947f71baa0cba2f709 (diff)
Fix free pages count in LinkerSmallObjectAllocator
Free pages count should be incremented by 1 when a new page is allocated. Without this fix, free pages count underflows and the allocator ends up freeing a free page whenever the last object in that page is freed. In other words, it doesn't hold onto a free page as expected and thus we may see more mmap/munmap calls. Test: Set breakpoint at the end of __linker_init and check free_pages_cnt values are either 0 or 1. Change-Id: I259a3a27329aab6835c21b4aa7ddda89dac9655b
Diffstat (limited to 'libc/malloc_hooks/malloc_hooks.cpp')
0 files changed, 0 insertions, 0 deletions