/* * allocate memory until we can't get any more, and fill allocated space */ #include #include #include #include int main(void) { int * space; const int incr = 1L << 29; int count = 0; do { printf("call #%d to malloc for 0x%lx bytes ....\n", ++count, incr*sizeof(*space)); space = malloc(incr*sizeof(*space)); memset(space, 1, incr*sizeof(*space)); /* sleep(1); */ } while (space != NULL); return 0; }