All pastes #193006 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-10-06 13:59 UTC
rendered paste body
#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);
  }


}