fork(1) download
  1. #include <iostream>
  2. #include <vector>
  3.  
  4.  
  5. void* operator new(std::size_t count)
  6. {
  7. std::cout<<"Allocated: "<<count<<" bytes\n";
  8. return malloc(count);
  9. }
  10.  
  11. class MyVector : public std::vector<int> {};
  12.  
  13. class Empty {};
  14.  
  15. int main()
  16. {
  17. std::vector<int>* obj = new MyVector;
  18. delete obj;
  19.  
  20. Empty* empty = new Empty;
  21. delete empty;
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
Allocated: 12 bytes
Allocated: 1 bytes