Don't use mallinfo on non-android and non-glibc

pull/159/head
jvoisin 2021-12-23 18:27:18 +01:00 committed by Daniel Micay
parent 460fef456d
commit 769e01fc4b
1 changed files with 2 additions and 0 deletions

View File

@ -5,6 +5,7 @@
#include "test_util.h" #include "test_util.h"
static void print_mallinfo(void) { static void print_mallinfo(void) {
#if defined(__GLIBC__) || defined(__ANDROID__)
struct mallinfo info = mallinfo(); struct mallinfo info = mallinfo();
printf("mallinfo:\n"); printf("mallinfo:\n");
printf("arena: %zu\n", (size_t)info.arena); printf("arena: %zu\n", (size_t)info.arena);
@ -17,6 +18,7 @@ static void print_mallinfo(void) {
printf("uordblks: %zu\n", (size_t)info.uordblks); printf("uordblks: %zu\n", (size_t)info.uordblks);
printf("fordblks: %zu\n", (size_t)info.fordblks); printf("fordblks: %zu\n", (size_t)info.fordblks);
printf("keepcost: %zu\n", (size_t)info.keepcost); printf("keepcost: %zu\n", (size_t)info.keepcost);
#endif
} }
OPTNONE int main(void) { OPTNONE int main(void) {