Tag: new
3 posts
-
C++ malloc vs new vs make_unique
C++ malloc vs new vs make_unique compared: constructor calls, type safety, failure behavior (nullptr vs bad_alloc), alignment, operator new overloading, and why make_unique is the default in modern C++.
-
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.