OSDN Git Service

malloc_debug: round 0 byte allocations up to 1 byte
authorColin Cross <ccross@android.com>
Thu, 10 Mar 2016 01:56:14 +0000 (17:56 -0800)
committerColin Cross <ccross@android.com>
Thu, 10 Mar 2016 02:04:01 +0000 (18:04 -0800)
commit15af478080cfbfa800fb8172fdf70a84075925e3
treed8151e7b53b01e62405c014c7342352328fc83a0
parentb23c6606d2326f8835fc7fc35b23ff7ee5a48f48
malloc_debug: round 0 byte allocations up to 1 byte

0 byte allocations can cause problems if they are immediately followed
by another allocation with no header, as both allocations will have the
same address.  Treat 0 byte allocations as 1 byte allocations so that
debug_iterate will return separate addresses for them.

Bug: 27578580
Change-Id: Ia8dc3481fa7062391e9b3ae58a36e8d47e7ee557
libc/malloc_debug/malloc_debug.cpp