void* operator new(size_t size)
{
std::cout << "Allocated memory: " << size << std::endl;
void * p = malloc(size);
return p;
}
void operator delete(void* p) noexcept
{
std::cout << "Deallocated memory" << std::endl;
free(p);
}
int main(int argc, char** argv)
{
std::string small_string("small");
std::string very_big_string("very_very_very_very_big_string");
return EXIT_SUCCESS;
}