Getting started

Learn memory

Notes on how Rust manages memory, from ownership and borrowing to raw pointers, written as I learn them

Why start with memory

Most of what makes Rust different is about memory. Ownership decides who frees a value, borrowing decides who can use it in the meantime, and lifetimes make sure no reference outlives what it points to. unsafe is where you take over some of those checks yourself

Each page pairs a short explanation with memory snapshots drawn like the visualizers, so you can see where every value lives on the stack and the heap, and what happens to it as the program runs

What's here

  • Unsafe Rust: raw pointers, undefined behavior and the promises unsafe asks you to keep
  • Real world: write-ups of real posts about Rust memory, and what they teach
  • Playground: how your own programs become walkthroughs, and what it can't run yet