Miscellany
public text v1 · immutable#include <stdlib.h>
#include <stdio.h>
#define INCR (1024*1024)
main()
{
char *mem;
unsigned total = 0;
for(;;) {
mem = malloc(INCR);
int i;
for (i = 0; i < INCR; i++)
mem[i] = 42;
total += INCR;
printf("Total so far: %u MB\n", total / 1024 / 1024);
}
}