You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-08-08 08:22:52 +02:00
Add speaker note that arrays go on the stack (#2826)
This commit is contained in:
@ -65,4 +65,9 @@ fn main() {
|
|||||||
- Adding `#`, eg `{a:#?}`, invokes a "pretty printing" format, which can be
|
- Adding `#`, eg `{a:#?}`, invokes a "pretty printing" format, which can be
|
||||||
easier to read.
|
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.
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
Reference in New Issue
Block a user