/* big_malloc.c compile with -m64 option */ #include #include int main(int argc, char *argv[]) { char *p; /* pointer for malloc */ double *a; /* pointer for calloc */ int i; long gb = 1000000000L; long gbx; long j; printf("big_malloc.c running, 10 malloc and free 1GB \n"); for(i=0; i<10; i++) { printf("about to malloc and free 1GB the %d time \n",i+1); p = malloc(gb); if(p==NULL) { printf("malloc failed, bye \n"); exit(1); } /* write to be sure space is available */ for(j=0; j