mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2025-05-02 22:35:11 -04:00
add real mallinfo implementation for Android
Android Q uses the mallinfo implementation in the ART GC:c220f98180
1575267302
This commit is contained in:
parent
7acebaa837
commit
350d0e5fd2
5 changed files with 96 additions and 4 deletions
|
@ -8,7 +8,8 @@ CPPFLAGS += \
|
|||
-DSLAB_CANARY=$(CONFIG_SLAB_CANARY)
|
||||
|
||||
EXECUTABLES := \
|
||||
offset
|
||||
offset \
|
||||
mallinfo
|
||||
|
||||
all: $(EXECUTABLES)
|
||||
|
||||
|
|
21
test/mallinfo.c
Normal file
21
test/mallinfo.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
#include <malloc.h>
|
||||
|
||||
__attribute__((optimize(0)))
|
||||
int main(void) {
|
||||
malloc(1024 * 1024 * 1024);
|
||||
malloc(16);
|
||||
malloc(32);
|
||||
malloc(64);
|
||||
|
||||
struct mallinfo info = mallinfo();
|
||||
printf("arena: %zu\n", info.arena);
|
||||
printf("ordblks: %zu\n", info.ordblks);
|
||||
printf("smblks: %zu\n", info.smblks);
|
||||
printf("hblks: %zu\n", info.hblks);
|
||||
printf("hblkhd: %zu\n", info.hblkhd);
|
||||
printf("usmblks: %zu\n", info.usmblks);
|
||||
printf("fsmblks: %zu\n", info.fsmblks);
|
||||
printf("uordblks: %zu\n", info.uordblks);
|
||||
printf("fordblks: %zu\n", info.fordblks);
|
||||
printf("keepcost: %zu\n", info.keepcost);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue