Android Q uses mallinfo as part of the ART GC for better integration with native code: developer.android.com/preview/featur.
Commits:
android.googlesource.com/platform/art/+
android.googlesource.com/platform/art/+
I added an actual implementation to hardened_malloc in preparation for moving to Q:
github.com/GrapheneOS/har
Conversation
This is broken in glibc due to using `int` instead of `size_t` and incorrectly setting fields so I still expose a stub implementation for that platform. Android inherited it from dlmalloc which walks the heap for this and added it to jemalloc for compatibility when they migrated.
Replying to
Implementation for jemalloc in Android is quite similar to this one. They iterate through the arenas (grabbing each lock) to get the stats for mappings and large / huge allocations followed by iterating through the size class bins (grabbing each lock). They also added some APIs.
1
