Advertisement
Guest User

Untitled

a guest
Dec 22nd, 2011
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement