Slide 57
Slide 57 text
RUST
DEVOXX FRANCE 2024
Rust Heap and Stack
fn myfunc() {
let mut list = Vec::new();
for x in 1..6 {
list.push(x);
}
otherfunc(list)
// otherstuff…
}
fn otherfunc(list: Vec) {
println!("{:?}", list);
}
Stack Frame (myfunc)
list = {len: 5, cap: 8, ptr: 0xFCFA}
x = 6
1 2 3 4 5 6 0 0
Stack Frame (otherfunc)
list = {len: 5, cap: 8, ptr: 0xFCFA}