Guest User

Untitled

a guest
Jan 20th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. cd /tmp
  2. cat > test.c <<"EOF"
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. int main()
  6. {
  7. size_t allocated=0;
  8. while(1)
  9. {
  10. const size_t chunkSize=4096;
  11. char* p=malloc(chunkSize);
  12. if(!p) return 0;
  13. *p=1;
  14. allocated+=chunkSize;
  15. printf("%zun",allocated);
  16. }
  17. }
  18. EOF
  19. gcc test.c -o test -m32 && ./test | tail -n1
Add Comment
Please, Sign In to add comment