fork download
  1. #include <iostream>
  2.  
  3. struct thing {
  4. long long value;
  5. thing* next;
  6. char buffer[4096-sizeof(thing*)-sizeof(long long)];
  7. thing(long long v):value(v),next(NULL){}
  8. void touch(long long v) {
  9. thing* cur = this;
  10. while(cur->next) {
  11. cur = cur->next;
  12. cur->value=v;
  13. }
  14. cur->next = new thing(v);
  15. }
  16. };
  17.  
  18. int main()
  19. {
  20. thing p(0);
  21. for(long long i=0; i<(1ll<<62); ++i) {
  22. try {
  23. p.touch(i);
  24. } catch(...) {}
  25. }
  26. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty