From 22675cd8dc75d8b8d4b0f818f5b093efbc364802 Mon Sep 17 00:00:00 2001 From: Jasper Ras Date: Fri, 8 Aug 2025 22:44:15 +0200 Subject: vault backup: 2025-08-08 22:44:15 --- Variables lives in the stack.md | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 Variables lives in the stack.md (limited to 'Variables lives in the stack.md') diff --git a/Variables lives in the stack.md b/Variables lives in the stack.md deleted file mode 100644 index a929a67..0000000 --- a/Variables lives in the stack.md +++ /dev/null @@ -1,19 +0,0 @@ -[[Rust]] -[[Boxes live in the heap]] - - ---- - -The stack consists of frames. - -Frames are just mappings of names to values within a single scope, they are tightly coupled to a specific function - -Freeing is the act of discarding such a frame. - -If we assign a variable such as -```rust -let a = [0; 1_000_000]; -let b = a; -``` - -the value of a is **copied** to b (thus we get two huge arrays). This is **expensive**. Think about what happens when we call a function. \ No newline at end of file -- cgit v1.2.3