From 1a3c11b03e521df0c5f82977534499a43e82098a Mon Sep 17 00:00:00 2001 From: Nicole L Date: Wed, 23 Jul 2025 10:37:19 -0700 Subject: [PATCH] Add speaker note that arrays go on the stack (#2826) --- src/tuples-and-arrays/arrays.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tuples-and-arrays/arrays.md b/src/tuples-and-arrays/arrays.md index f3c982e7..7ed57288 100644 --- a/src/tuples-and-arrays/arrays.md +++ b/src/tuples-and-arrays/arrays.md @@ -65,4 +65,9 @@ fn main() { - Adding `#`, eg `{a:#?}`, invokes a "pretty printing" format, which can be easier to read. +- Arrays are not heap-allocated. They are regular values with a fixed size known + at compile time, meaning they go on the stack. This can be different from what + students expect if they come from a garbage collected language, where arrays + may be heap allocated by default. +