SHARE
TWEET

Untitled

a guest Dec 22nd, 2011 15 Never
  1. #include <unistd.h>
  2.  
  3. void *malloc(int size) {
  4.         write(2,"I malloc'd\n",sizeof("I malloc'd\n"));
  5.         return NULL;
  6. }
  7.  
  8. void alloc_one_meg() {
  9.     int *pmeg = (int *) malloc(250000*sizeof(int));
  10.     int *p = pmeg;
  11. }
  12.  
  13. main()
  14. {
  15.     int i;
  16.     for (i=0; i<1000; i++) {
  17.         alloc_one_meg();
  18.     }
  19. }
RAW Paste Data
Top