1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00
libhermit/usr/tests/test-malloc.c

30 lines
411 B
C

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