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.
1
2
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.