The get_malloc_leak_info() currently asssumes that the totalMemory out parameter
was pre-initialized to zero before the routine is called. If it is not then the
accumulated totalMemory value will be incorrect. It is likely that many callers
will simply allocate totalMemory on the stack with no initialization and assume
that get_malloc_leak_info will set the proper value.
As an example, the caller in frameworks/base/core/jni/android_os_Debug.cpp
calls get_malloc_leak_info() with the address uninitiazed stack variable
for totalMemory. It is probably best to fix this in get_malloc_leak_info.
Change-Id: I84c927c3781419585794726115b7d34d8fdd24ae
Previously, the malloc leak checking code would crash in qsort()
if null entries existed in its bookkeeping table. This change
makes the comparison function detect null entries and sort them
to the end safely.
Change-Id: I88244a7df1e289dd9d7992ce29606d505bd63079
This change is intended to eliminate need to replace libc.so with libc_debug.so in order to enablememory allocation debugging.
This is also the first step towards implementing extended memoryallocation debugging using emulator's capabilities in monitoring memory access.