summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.obsidian/app.json3
-rw-r--r--.trash/Borrow checker.md1
-rw-r--r--.trash/Fixing unsafe programs.md0
-rw-r--r--.trash/Image and network ref are uuids.md1
-rw-r--r--.trash/bilaterale-gesprekken-met-rutger.md0
-rw-r--r--A place is anything that is valid to put on the left-hand side of an assignment.md2
-rw-r--r--Accessed data from dereferencing a pointer cannot be mutated.md1
-rw-r--r--Aliasing is accessing the same data through different variables.md9
-rw-r--r--Aliasing just means that multiple variables point to the same heap data.md9
-rw-r--r--Bilat 23 July 2025.md (renamed from bilat-2025-07-23.md)6
-rw-r--r--Bilat 25 juni 2025.md4
-rw-r--r--Bilat 6 Augustus 2025.md11
-rw-r--r--Bilaterale gesprekken met Rutger.md4
-rw-r--r--Borrow checker.md8
-rw-r--r--Box deallocation principle.md2
-rw-r--r--Cirros is recommened as the image to use in tests.md3
-rw-r--r--Clone a reference in a function to modify it.md3
-rw-r--r--Creating a reference to a variable is called borrowing.md2
-rw-r--r--Data must outlive any references to it.md14
-rw-r--r--Defer borrow checking to runtime with garbage collection.md11
-rw-r--r--GroupONE.md1
-rw-r--r--GroupVPS Platform.md8
-rw-r--r--GroupVPS.md1
-rw-r--r--It is illegal to create a mutable reference while an immutable reference is live.md3
-rw-r--r--Lifetime specifier.md2
-rw-r--r--Move ownership out of the function.md1
-rw-r--r--Moved heap data principle.md1
-rw-r--r--Mutable references are safe because they prevent aliasing.md2
-rw-r--r--OVN Clusters.md0
-rw-r--r--Ownership.md6
-rw-r--r--Passing a pointer to heap data as an argument to a function transfers its ownership.md1
-rw-r--r--Pointer safety principle.md5
-rw-r--r--Provide a slot by the caller.md1
-rw-r--r--Requesting PTR zones for IP ranges.md4
-rw-r--r--Return a static literal.md8
-rw-r--r--Rust principles.md3
-rw-r--r--Rust.md21
-rw-r--r--SOPs.md1
-rw-r--r--Shortening the lifetime of borrowed variables before mutating it.md9
-rw-r--r--Smaller flavors are recommended due to their faster boot times.md3
-rw-r--r--Tempest.md2
-rw-r--r--To put data on the heap use a Box.md (renamed from Boxes live in the heap.md)6
-rw-r--r--UEFI Boot OpenStack Nova.md3
-rw-r--r--Untitled.md0
-rw-r--r--Useful sysdoc links.md6
-rw-r--r--Variables lives in the stack.md19
-rw-r--r--Variables lives on the stack.md16
-rw-r--r--When boxes are deallocated.md8
-rw-r--r--When heap data is deallocated.md7
49 files changed, 155 insertions, 87 deletions
diff --git a/.obsidian/app.json b/.obsidian/app.json
index 6abe4c1..c9e99e1 100644
--- a/.obsidian/app.json
+++ b/.obsidian/app.json
@@ -1,3 +1,4 @@
{
- "alwaysUpdateLinks": true
+ "alwaysUpdateLinks": true,
+ "promptDelete": false
} \ No newline at end of file
diff --git a/.trash/Borrow checker.md b/.trash/Borrow checker.md
new file mode 100644
index 0000000..7a1987e
--- /dev/null
+++ b/.trash/Borrow checker.md
@@ -0,0 +1 @@
+[[Rust]]
diff --git a/.trash/Fixing unsafe programs.md b/.trash/Fixing unsafe programs.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.trash/Fixing unsafe programs.md
diff --git a/.trash/Image and network ref are uuids.md b/.trash/Image and network ref are uuids.md
new file mode 100644
index 0000000..2399f83
--- /dev/null
+++ b/.trash/Image and network ref are uuids.md
@@ -0,0 +1 @@
+The config \ No newline at end of file
diff --git a/.trash/bilaterale-gesprekken-met-rutger.md b/.trash/bilaterale-gesprekken-met-rutger.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.trash/bilaterale-gesprekken-met-rutger.md
diff --git a/A place is anything that is valid to put on the left-hand side of an assignment.md b/A place is anything that is valid to put on the left-hand side of an assignment.md
index cd679e7..cd6317f 100644
--- a/A place is anything that is valid to put on the left-hand side of an assignment.md
+++ b/A place is anything that is valid to put on the left-hand side of an assignment.md
@@ -1,5 +1,3 @@
-[[Borrow checker]]
-
It is not THE left hand side of an assignment but anything that is valid to put there. But they can appear anywhere from what it looks like.
It includes:
diff --git a/Accessed data from dereferencing a pointer cannot be mutated.md b/Accessed data from dereferencing a pointer cannot be mutated.md
index 6fe3195..df0d555 100644
--- a/Accessed data from dereferencing a pointer cannot be mutated.md
+++ b/Accessed data from dereferencing a pointer cannot be mutated.md
@@ -1 +1,2 @@
[[Creating a reference to a variable is called borrowing]]
+
diff --git a/Aliasing is accessing the same data through different variables.md b/Aliasing is accessing the same data through different variables.md
deleted file mode 100644
index 16db4a3..0000000
--- a/Aliasing is accessing the same data through different variables.md
+++ /dev/null
@@ -1,9 +0,0 @@
-[[Rust]]
-[[Ownership]]
-[[Dereferencing is to access the data behind a pointer]]
-[[Pointer safety principle]]
-
-
----
-
-Mutating an alias is dangerous. \ No newline at end of file
diff --git a/Aliasing just means that multiple variables point to the same heap data.md b/Aliasing just means that multiple variables point to the same heap data.md
new file mode 100644
index 0000000..5049d5a
--- /dev/null
+++ b/Aliasing just means that multiple variables point to the same heap data.md
@@ -0,0 +1,9 @@
+[[Rust]]
+[[Ownership]]
+[[Dereferencing is to access the data behind a pointer]]
+[[Pointer safety principle]]
+
+
+---
+
+Mutating an alias from one part of the program can cause unforeseen effects in other parts of the program that reference the same data. Rust prevents this by making sure that mutable references prevent aliasing. \ No newline at end of file
diff --git a/bilat-2025-07-23.md b/Bilat 23 July 2025.md
index 2f0525e..5b8ff22 100644
--- a/bilat-2025-07-23.md
+++ b/Bilat 23 July 2025.md
@@ -1,9 +1,3 @@
-[[bilaterale-gesprekken-met-rutger]]
-
----
-
calendar
-
keystone auth middleware maken -> restrict ip per user.
-
marcel huck - share netwerk
diff --git a/Bilat 25 juni 2025.md b/Bilat 25 juni 2025.md
index 5428dbb..181e478 100644
--- a/Bilat 25 juni 2025.md
+++ b/Bilat 25 juni 2025.md
@@ -1,7 +1,3 @@
-[[Bilaterale gesprekken met Rutger]]
-
----
-
Blij met Ali. Doet het erg goed, pakt zelf dingen snel op, weinig assistentie nodig gehad dusver. Stelt op tijd vragen en snapt vrijwel direct wat je bedoelt.
Mohammed vind een ERROR loggen wanneer iets werkt als verwacht normaal.. ik heb duidelijk aangegeven dat dat niet normaal is.
diff --git a/Bilat 6 Augustus 2025.md b/Bilat 6 Augustus 2025.md
new file mode 100644
index 0000000..2e50edd
--- /dev/null
+++ b/Bilat 6 Augustus 2025.md
@@ -0,0 +1,11 @@
+# Jasper
+Rust aan het leren in vrije tijd..
+Verder niets noemenswaardigs gebeurd de afgelopen 2 weken.
+
+# Rutger
+t.b.d
+
+---
+
+Gepraat over Rust, vakantie (andere rust) etc.
+Thomas Lunkwitz gaat weg. Heeft weinig voor ons gedaan behalve wat gare doc structuren. \ No newline at end of file
diff --git a/Bilaterale gesprekken met Rutger.md b/Bilaterale gesprekken met Rutger.md
index a7d6b0f..48d6ab4 100644
--- a/Bilaterale gesprekken met Rutger.md
+++ b/Bilaterale gesprekken met Rutger.md
@@ -1,2 +1,4 @@
-[[GroupONE]]
[[Bilat 25 juni 2025]]
+[[Bilat 9 july 2025]]
+[[Bilat 23 July 2025]]
+[[Bilat 6 Augustus 2025]]
diff --git a/Borrow checker.md b/Borrow checker.md
deleted file mode 100644
index 09700ba..0000000
--- a/Borrow checker.md
+++ /dev/null
@@ -1,8 +0,0 @@
-[[Rust]]
-[[Ownership]]
-[[Dereferencing is to access the data behind a pointer]]
-[[Aliasing is accessing the same data through different variables]]
-[[Variables are subject to permissions similar to files on linux]]
-[[References temporarily remove permissions]]
-[[Creating a reference to a variable is called borrowing]]
-[[It is illegal to create a mutable reference while an immutable reference is live]]
diff --git a/Box deallocation principle.md b/Box deallocation principle.md
index 01418d4..10975c4 100644
--- a/Box deallocation principle.md
+++ b/Box deallocation principle.md
@@ -1,5 +1,5 @@
[[Rust principles]]
-[[When boxes are deallocated]]
+[[When heap data is deallocated]]
---
diff --git a/Cirros is recommened as the image to use in tests.md b/Cirros is recommened as the image to use in tests.md
new file mode 100644
index 0000000..171dbbf
--- /dev/null
+++ b/Cirros is recommened as the image to use in tests.md
@@ -0,0 +1,3 @@
+https://docs.openstack.org/tempest/latest/configuration.html
+
+They recommend to use cirros because it is small and boots so fast. This also works in our favor because the config expects image uuids. \ No newline at end of file
diff --git a/Clone a reference in a function to modify it.md b/Clone a reference in a function to modify it.md
new file mode 100644
index 0000000..73590f0
--- /dev/null
+++ b/Clone a reference in a function to modify it.md
@@ -0,0 +1,3 @@
+[[Cloning a box does a deep copy of the heap data]]
+
+To be able to safely modify the heap value of a reference passed to a function we can clone it's heap value. This can be expensive. \ No newline at end of file
diff --git a/Creating a reference to a variable is called borrowing.md b/Creating a reference to a variable is called borrowing.md
index 245d060..2790d63 100644
--- a/Creating a reference to a variable is called borrowing.md
+++ b/Creating a reference to a variable is called borrowing.md
@@ -8,6 +8,6 @@
Creating a reference is done with an ampersand. It creates a pointer to another variable in the stack, which could be a pointer to something on the heap.
-This is called borrowing.
+This is called borrowing. ( Borrow, but not own, its heap data so to speak? )
A reference is a non-owning pointer; so if we create a reference to a Box we can safely have it discarded and continue using the box because the heap data is not deallocated. \ No newline at end of file
diff --git a/Data must outlive any references to it.md b/Data must outlive any references to it.md
new file mode 100644
index 0000000..162bf30
--- /dev/null
+++ b/Data must outlive any references to it.md
@@ -0,0 +1,14 @@
+[[Pointer safety principle]]
+[[Variables are subject to permissions similar to files on linux]]
+[[Lifetime specifier]]
+[[When heap data is deallocated]]
+[[Variables lives on the stack]]
+[[Ownership]]
+
+This is literally talking about heap data and references (ie `&String`): the heap data must not be freed when we try to use a reference to it.
+
+This is enforced in one of two ways.
+
+Firstly, if a reference is created to a variable it loses its Own permission: thus we can't drop it, because the compiler expects that permission on the place where it is dropped.
+
+Secondly, it uses the Flow permission and requires a a lifetime specifier when we return things from functions. \ No newline at end of file
diff --git a/Defer borrow checking to runtime with garbage collection.md b/Defer borrow checking to runtime with garbage collection.md
new file mode 100644
index 0000000..fbbf634
--- /dev/null
+++ b/Defer borrow checking to runtime with garbage collection.md
@@ -0,0 +1,11 @@
+It's possible to tell the compiler that we want something garbage collected.
+
+Reference counted pointer:
+```rust
+use std::rc::Rc
+fn return() -> Rc<String> {
+ let s = Rc::new(String::from("Hello"));
+ Rc::clone(&s)
+}
+```
+
diff --git a/GroupONE.md b/GroupONE.md
index e69de29..35875cc 100644
--- a/GroupONE.md
+++ b/GroupONE.md
@@ -0,0 +1 @@
+[[GroupVPS]]
diff --git a/GroupVPS Platform.md b/GroupVPS Platform.md
index b188b0e..42a3bab 100644
--- a/GroupVPS Platform.md
+++ b/GroupVPS Platform.md
@@ -3,12 +3,10 @@ tags:
- work
- groupvps
---
-Our [[OVN Clusters]].
+[[Bilaterale gesprekken met Rutger]]
+[[SOPs]]
-
-
-
-Nowadays [[ceilometer data is going into Prometheus as Ihor fixed the out of order issue]]
+[[ceilometer data is going into Prometheus as Ihor fixed the out of order issue]]
[[Project naming conventions]]
[[Application credentials]]
diff --git a/GroupVPS.md b/GroupVPS.md
new file mode 100644
index 0000000..f2b95fb
--- /dev/null
+++ b/GroupVPS.md
@@ -0,0 +1 @@
+[[GroupVPS Platform]]
diff --git a/It is illegal to create a mutable reference while an immutable reference is live.md b/It is illegal to create a mutable reference while an immutable reference is live.md
index a201199..f9e0796 100644
--- a/It is illegal to create a mutable reference while an immutable reference is live.md
+++ b/It is illegal to create a mutable reference while an immutable reference is live.md
@@ -1,2 +1 @@
-
-| \ No newline at end of file
+Why? \ No newline at end of file
diff --git a/Lifetime specifier.md b/Lifetime specifier.md
index b1c5caa..a5dfd2c 100644
--- a/Lifetime specifier.md
+++ b/Lifetime specifier.md
@@ -1,3 +1 @@
-[[Borrow checker]]
-
A flow permission cannot be given if a function signature states that it returns a reference but the function has multiple returns referencing potentially different variables so the borrow checker doesn't know if it's safe or not. \ No newline at end of file
diff --git a/Move ownership out of the function.md b/Move ownership out of the function.md
new file mode 100644
index 0000000..0a9397a
--- /dev/null
+++ b/Move ownership out of the function.md
@@ -0,0 +1 @@
+Don't return a reference to a string, instead just return the string. \ No newline at end of file
diff --git a/Moved heap data principle.md b/Moved heap data principle.md
index a25f60a..e8a34ac 100644
--- a/Moved heap data principle.md
+++ b/Moved heap data principle.md
@@ -1,4 +1,3 @@
-[[Rust principles]]
[[Ownership]]
---
diff --git a/Mutable references are safe because they prevent aliasing.md b/Mutable references are safe because they prevent aliasing.md
index bb837f7..13ee277 100644
--- a/Mutable references are safe because they prevent aliasing.md
+++ b/Mutable references are safe because they prevent aliasing.md
@@ -1,5 +1,5 @@
[[Pointer safety principle]]
-[[Aliasing is accessing the same data through different variables]]
+[[Aliasing just means that multiple variables point to the same heap data]]
[[Downgrading a mutable reference]]
---
diff --git a/OVN Clusters.md b/OVN Clusters.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/OVN Clusters.md
diff --git a/Ownership.md b/Ownership.md
index 5484772..772153f 100644
--- a/Ownership.md
+++ b/Ownership.md
@@ -1,14 +1,16 @@
[[Rust]]
-[[When boxes are deallocated]]
+[[When heap data is deallocated]]
[[Moved heap data principle]]
[[Creating a reference to a variable is called borrowing]]
---
-When we assign a Box to a name we say that name owns the box. Any time we copy the pointer to that box to another name we also pass ownership to that name.
+When we assign a Box to a name we say that name owns the box. Any time we copy the *pointer* to that box to another name we also pass ownership to that name.
After we pass ownership and move into a new scope the original variable is freed. Thus when we return to the original scope it is no longer possible to use it.
+[[Passing a pointer to heap data as an argument to a function transfers its ownership]]
+
![[Pasted image 20250804184242.png]]
> Wherever the stack variable is greyed out means it is no longer the owner. \ No newline at end of file
diff --git a/Passing a pointer to heap data as an argument to a function transfers its ownership.md b/Passing a pointer to heap data as an argument to a function transfers its ownership.md
new file mode 100644
index 0000000..754f141
--- /dev/null
+++ b/Passing a pointer to heap data as an argument to a function transfers its ownership.md
@@ -0,0 +1 @@
+Passing a variable into a parameter of a function is basically an assignment. So if we pass a pointer to heap data to a function the [[Moved heap data principle]] states that ownership is passed to that function. Thus the original variable can not be used anymore, for example after the function returns. \ No newline at end of file
diff --git a/Pointer safety principle.md b/Pointer safety principle.md
index d47520c..45c0f5c 100644
--- a/Pointer safety principle.md
+++ b/Pointer safety principle.md
@@ -1,8 +1,3 @@
-[[Rust principles]]
-[[Borrow checker]]
-
----
-
Data should never be aliased and mutated at the same time.
Boxes are not allowed to be aliased. References are meant to be aliased: the pointer safety principle is ensured via the borrow checker. \ No newline at end of file
diff --git a/Provide a slot by the caller.md b/Provide a slot by the caller.md
new file mode 100644
index 0000000..14ff371
--- /dev/null
+++ b/Provide a slot by the caller.md
@@ -0,0 +1 @@
+Have a function take a mutable reference as a parameter: The "Slot" so the caller can be responsible for allocating and regaining ownership after the function returns. \ No newline at end of file
diff --git a/Requesting PTR zones for IP ranges.md b/Requesting PTR zones for IP ranges.md
new file mode 100644
index 0000000..f5585f8
--- /dev/null
+++ b/Requesting PTR zones for IP ranges.md
@@ -0,0 +1,4 @@
+Add a ticket to sysdns requesting them to add the arpa record to `service.g1i.one` NS. Then the network team has to config the IP space in RIPE.
+
+[SOP on confluence](https://group-one.atlassian.net/wiki/spaces/VPS/pages/33036599687/IP+ranges)
+[Previous SYSDNS tickets](https://group-one.atlassian.net/issues/?jql=creator%20%3D%20currentUser%28%29%20AND%20project%20%3D%20SYSDNS)
diff --git a/Return a static literal.md b/Return a static literal.md
new file mode 100644
index 0000000..bbf6a47
--- /dev/null
+++ b/Return a static literal.md
@@ -0,0 +1,8 @@
+If the data doesn't change it's possible to return a literal, which is static:
+```rust
+fn return() -> &'static str {
+ "yest"
+}
+```
+
+not sure what benefit this offers though, we could just use a const? \ No newline at end of file
diff --git a/Rust principles.md b/Rust principles.md
index dc39b12..7a23c84 100644
--- a/Rust principles.md
+++ b/Rust principles.md
@@ -1,4 +1,3 @@
-[[Rust]]
-
[[Box deallocation principle]]
[[Moved heap data principle]]
+[[Pointer safety principle]] \ No newline at end of file
diff --git a/Rust.md b/Rust.md
index be302f9..d053f90 100644
--- a/Rust.md
+++ b/Rust.md
@@ -26,10 +26,23 @@
[[Returning values from loops]]
[[Loop over an array with for-in]]
[[Undefined behaviour is caught by the compiler]]
-[[Variables lives in the stack]]
-[[Boxes live in the heap]]
+[[Variables lives on the stack]]
+[[To put data on the heap use a Box]]
[[Cloning a box does a deep copy of the heap data]]
-[[Aliasing is accessing the same data through different variables]]
-[[Borrow checker]]
+[[Aliasing just means that multiple variables point to the same heap data]]
[[A place is anything that is valid to put on the left-hand side of an assignment]]
+[[Ownership]]
+[[Dereferencing is to access the data behind a pointer]]
+[[Aliasing just means that multiple variables point to the same heap data]]
+[[Variables are subject to permissions similar to files on linux]]
+[[References temporarily remove permissions]]
+[[Creating a reference to a variable is called borrowing]]
+[[It is illegal to create a mutable reference while an immutable reference is live]]
+[[Data must outlive any references to it]]
+[[Move ownership out of the function]]
+[[Return a static literal]]
+[[Defer borrow checking to runtime with garbage collection]]
+[[Provide a slot by the caller]]
+[[Clone a reference in a function to modify it]]
+[[Shortening the lifetime of borrowed variables before mutating it]]
diff --git a/SOPs.md b/SOPs.md
new file mode 100644
index 0000000..e065286
--- /dev/null
+++ b/SOPs.md
@@ -0,0 +1 @@
+[[Requesting PTR zones for IP ranges]]
diff --git a/Shortening the lifetime of borrowed variables before mutating it.md b/Shortening the lifetime of borrowed variables before mutating it.md
new file mode 100644
index 0000000..d17506f
--- /dev/null
+++ b/Shortening the lifetime of borrowed variables before mutating it.md
@@ -0,0 +1,9 @@
+[[Creating a reference to a variable is called borrowing]]
+
+---
+
+If a function modifies a borrowed variable, we can try to find a way to shorten the lifetime of the borrow.
+
+One way would be to clone the value into a new variable and mutate that, but it can be expensive.
+
+Another way could be to use some property of the variable instead of the variable itself, ie the length of a string. \ No newline at end of file
diff --git a/Smaller flavors are recommended due to their faster boot times.md b/Smaller flavors are recommended due to their faster boot times.md
new file mode 100644
index 0000000..c86262f
--- /dev/null
+++ b/Smaller flavors are recommended due to their faster boot times.md
@@ -0,0 +1,3 @@
+[[Cirros is recommened as the image to use in tests]]
+
+They recommend to use small flavors due their fast boot times. This goes well together with the fact that they recommend cirros as the image to use. \ No newline at end of file
diff --git a/Tempest.md b/Tempest.md
index 5c00c8c..6b3e620 100644
--- a/Tempest.md
+++ b/Tempest.md
@@ -7,3 +7,5 @@ tags:
---
+[[Cirros is recommened as the image to use in tests]]
+[[Smaller flavors are recommended due to their faster boot times]]
diff --git a/Boxes live in the heap.md b/To put data on the heap use a Box.md
index ec296c9..442adca 100644
--- a/Boxes live in the heap.md
+++ b/To put data on the heap use a Box.md
@@ -1,6 +1,6 @@
[[Rust]]
-[[Variables lives in the stack]]
-[[When boxes are deallocated]]
+[[Variables lives on the stack]]
+[[When heap data is deallocated]]
[[Ownership]]
---
@@ -12,4 +12,4 @@ let a = Box::new([0; 1_000_000]);
let b = a;
```
-Creates an array with 1 million entries on the heap and two variables on the stack that point to it. \ No newline at end of file
+Creates an array with 1 million entries on the heap and two variables on the stack that are a *pointer* to that heap data. \ No newline at end of file
diff --git a/UEFI Boot OpenStack Nova.md b/UEFI Boot OpenStack Nova.md
new file mode 100644
index 0000000..9e4cb11
--- /dev/null
+++ b/UEFI Boot OpenStack Nova.md
@@ -0,0 +1,3 @@
+[[GroupVPS Platform]]
+
+It should be possible to enable UEFI bootloader via an image property: `hw_firmware_type=uefi`. \ No newline at end of file
diff --git a/Untitled.md b/Untitled.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Untitled.md
diff --git a/Useful sysdoc links.md b/Useful sysdoc links.md
new file mode 100644
index 0000000..7e1ba2b
--- /dev/null
+++ b/Useful sysdoc links.md
@@ -0,0 +1,6 @@
+[[GroupVPS Platform]]
+[[GroupONE]]
+
+---
+
+[Firewall troubleshooting](https://sysdoc.one.com/base/firewall-troubleshooting/)
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
diff --git a/Variables lives on the stack.md b/Variables lives on the stack.md
new file mode 100644
index 0000000..579a984
--- /dev/null
+++ b/Variables lives on the stack.md
@@ -0,0 +1,16 @@
+[[Rust]]
+[[To put data on the heap use a Box]]
+
+
+---
+Each function has a frame consisting of variables. Those frames live on the stack.
+
+A frame is **deallocated when the function returns**.
+
+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
diff --git a/When boxes are deallocated.md b/When boxes are deallocated.md
deleted file mode 100644
index 96c2c34..0000000
--- a/When boxes are deallocated.md
+++ /dev/null
@@ -1,8 +0,0 @@
-[[Rust]]
-[[Boxes live in the heap]]
-[[Ownership]]
-
-
----
-
-A box's heap memory is freed automatically when the frame of the variable who owns the box is freed. \ No newline at end of file
diff --git a/When heap data is deallocated.md b/When heap data is deallocated.md
new file mode 100644
index 0000000..832881f
--- /dev/null
+++ b/When heap data is deallocated.md
@@ -0,0 +1,7 @@
+[[Rust]]
+[[To put data on the heap use a Box]]
+[[Ownership]]
+
+
+---
+Heap memory is freed automatically when the frame of the variable who **owns** it is freed. \ No newline at end of file