CS106B Dynamic Memory Management
An introduction to the world of dynamic memory, where we as programmers now have complete control over how computer memory is used. We create for the first time objects that can live beyond the lifespans of the functions where they are created. Lecture Video Contents 1. Overview 2. Motivation 3. Proof That Local Variables Die When We Leave a Function (Part 1 of 2) 4. Quokka Destruction: Proof That Local Variables Die When We Leave a Function (Part 2 of 2) 5. The Immortal Quokka (and C++'s new Operator) (and Dynamic Memory Allocation) 6. Memory Diagrams: Static vs. Dynamic Quokka Allocation 7. Concerns About the Immortal Quokka (and Memory Leaks!) 8. Returning Dynamically Allocated Variables from Functions 9. Super Important Rule of Thumb: For Every new, a Single delete 10. Super Important Note: Do Not Attempt to Dereference an Address After You delete It! 😳 11. Coding Tidbit: The Arrow Operator (->) 12. Array-Based Stack 13. const Member Functions 14. What's next? 15. Exercises Ove
CS106B Dynamic Memory Management Dynamic Memory Management Wednesday, July 22 An introduction to the world of dynamic memory , where we as programmers now have complete control over how computer memory is used. We create for the first time objects that can live beyond the lifespans of the functions where they are created. 📚 Readings: Text 12.1, 12.3, 14.2 📝 Lecture quiz on Canvas Contents 1. ArrayBasedStack Walkthrough 2. Overview 3. Motivation 4. Proof That Local Variables Die When We Leave a Function (Part 1 of 2) 5. Quokka Destruction: Proof That Local Variables Die When We Leave a Functi
related reading
- CS106B Object-Oriented Programmingweb.stanford.edu
- CS106B Classes and Dynamic Memoryweb.stanford.edu
- CS107E Assignment 4: Stack and Heapcs107e.github.io
- CS106B Implementing VectorIntweb.stanford.edu
- What is Ownership? - The Rust Programming Languagedoc.rust-lang.org
- What Every Programmer Should Know About Memorypeople.freebsd.org
- Untangling Lifetimes: The Arena Allocator - by Ryan Fleurydgtlgrove.com
- CppCon 2019: Arthur O'Dwyer “Back to Basics: Smart Pointers”youtube.com
- CS106B Stacks and Queuesweb.stanford.edu
- Destroy All Values: Designing Deinitialization in Programming Languages - Faultloregankra.github.io
- notes.pdfstudent.cs.uwaterloo.ca
- The Lost Art of Structure Packingcatb.org