Required tools for playing around with memory:
hexdumpobjdumpreadelfxxdgcore
| // demo_new_delete.cpp | |
| #include <cstddef> | |
| #include <new> | |
| struct Base { | |
| Base(); | |
| virtual ~Base(); // virtual => emits D0, D1, D2 | |
| static void* operator new(std::size_t); | |
| static void operator delete(void*) noexcept; | |
| }; |