mirror of
https://github.com/GrapheneOS/hardened_malloc.git
synced 2024-12-24 23:19:35 -05:00
22 lines
623 B
C
22 lines
623 B
C
|
#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);
|
||
|
}
|