Module 6 Memory Allocation and Layout
Module 6 - Memory Allocation and LayoutModule Overview
1.) C++ is not the C Language -- Course Introduction
2.) C++ Batteries Included - STL and GDB Debugging with the STL
3.) Functions 1: Making our code more modular | GDB and Functions
4.) Input and Output
5.) C++: Thinking about memory
6.) Memory Allocation and Layout
7.) Arrays, Splines, and SFML Library Introduction
8.) Building Data Structures -- Structs and Linked Lists
9.) Physical Structure of a C++ Project
10.) No Class
11.) Graphics Applications, Textures, Images, Sprites, and 2D Arrays
12.) Object-Oriented Programming 1
13.) Object-Oriented Programming 2
14.) Object-Oriented Programming 3 - Composition & Inheritance
15.) Binary Tree Data Structure
16.) C++ Templates - Code Generation and Generics
17.) Smart Pointers and Quad Trees
18.) Iterators and Algorithms
19.) Concurrency and Threading
20.) Final Project Discussion
23.) Holiday no class
24.) LValues, RValues, and Move Semantics
25.) Advanced Topic 1 - Scripting with C++ using Pybind11 and Lua
☰ Select another Module
Readings/Warmup (Do before class)
Stack and Heap Memory
C++ Block Scope | Modern Cpp Series
Dynamic Memory allocation with new and delete (and delete) | Modern Cpp Series
The ‘static’ keyword - understanding static vs stack vs heap memory - Modern Cpp Series
Test Your Knowledge (Optional)
Test your knowledge on the readings
] (This is not graded)
Commented Code Samples (if any)
For now I am linking code samples here:
Github Code Repository for the course
Nomad Game Engine
Nice article on performance of AoS vs SoA data structures
Direct Link to Slides
(Available to follow along during class)
(Graded) In-Class Activity link
In-Class Activity Link
This is graded, and only your first response is graded
This is an evaluation of what was learned in lecture.
Due one week from when the lecture takes place
In this module we take another look at memory allocation and layout!
Operating system view of a Process
A program is segmented into several regions of memory.
TODO: Insert picture of process here with Stack/Heap/Data/Text sections.
Automatically allocated data structure
Typically used for short-lived data.
Any time we create a variable, it is placed on the stack.
Heap/Free Store Data Structure
Used for longer lived and larger memory allocations.
More expensive to allocate, as we have to request memory from operating system (requires a context switch to the system)
Memory has to be searched for (either from the 'heap/free store' data structure, or otherwise allocated in the process)
Please do not redistribute or host any materials without e-mailing me first. I generally am happy to share the latest .pdf or slide presentation with those who ask. Thank you for your time!