Memory Management
  • attachments

  • Borrow Checker

  • Second Brain/PARA/Projects/Software Engineer in 2 years/Learning Rust/Memory Management/Borrowing

  • Box type
  • Lifetimes

  • Memory Management

  • Ownership

  • What is the Heap?

  • What is the Stack?

  • What is the Heap?

    What is the Stack?

    Normally managing memory on the heap comes from two ways:

    1. a garbage collector doing it for you or
      1. too much runtime overhead
    2. using malloc / free to do it yourself
      1. too error prone
    The Rust "Borrow Checker" (inside compiler) enforces rules at compile that makes violating memory safety impossible