Tag: heap
3 posts
-
Stack vs Heap in C++: Why Deep Recursion and Big Locals Overflow, and When to Allocate
C++ stack vs heap: stack overflow from deep recursion and huge locals, memory layout, performance, new/delete, smart pointer lead-in—Valgrind.
-
C++ Heap Corruption: Double Free and Wrong delete
Why heap corruption crashes far from the bug that caused it: overruns, double delete, delete vs delete[], and use-after-free, plus how ASan, Valgrind, and page heap catch them at the source.
-
C++ Heap Algorithms: make_heap, push_heap, pop_heap
How make_heap, push_heap, pop_heap and sort_heap keep a heap inside a vector, when priority_queue is simpler, and how comparators build a min-heap.