1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-23 00:00:05 +01:00
libhermit/usr/tests/test-malloc.c
2017-05-19 13:45:13 +02:00

28 lines
394 B
C

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#ifndef NUM_ITER
#define NUM_ITER 100000
#endif
#ifndef SIZE
#define SIZE 16*1024
#endif
int main(int argc, char** argv)
{
/* optionally: insert more useful stuff here */
void* buf;
for(int i=0; i<NUM_ITER; i++)
{
buf = malloc(SIZE*i);
free(buf);
}
malloc_stats();
return 0;
}