Tag: delete
3 posts
-
Tracking Down C++ Memory Leaks: Five Dangerous new/delete Patterns, Valgrind and ASan
What new and delete really do, five patterns that leak or corrupt memory, from double delete to delete vs delete[], and catching them with Valgrind and ASan.
-
What new and delete Actually Do in C++: operator new, delete[] Mismatch, Alignment, Placement new and Arenas
How a C++ new expression splits into operator new plus a constructor, why delete vs delete[] corrupts the heap, aligned and placement new, and pmr arenas.
-
C++ =default and =delete: Triviality, Deleted Overloads, and the Implicit Move Trap
Why =default on first declaration keeps a type trivial, how =delete blocks conversions, and why declaring a destructor silently turns your moves into copies.