fork download
  1. #include <iostream>
  2.  
  3. void* operator new(size_t s)
  4. {
  5. std::cout << "::operator new(" << s << ")\n";
  6. return (void*)malloc(s);
  7. }
  8.  
  9. int main() {
  10. std::string s("abc");
  11. for (int i = 1; i <= 8; ++i)
  12. s += s;
  13. return s.size();
  14. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
::operator new(16)
::operator new(19)
::operator new(25)
::operator new(37)
::operator new(61)
::operator new(109)
::operator new(205)
::operator new(397)
::operator new(781)