fork(1) download
  1. #include <iostream>
  2. #include <memory>
  3. #include <stdlib.h>
  4. #include <vector>
  5.  
  6. void* operator new(size_t n)
  7. {
  8. std::cout << "How did I get here?\n";
  9. return malloc(n);
  10. }
  11.  
  12. void operator delete(void* p)
  13. {
  14. free(p);
  15. }
  16.  
  17. int main()
  18. {
  19. std::vector<int> v(1);
  20. }
  21.  
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
How did I get here?