Rust makes you, the developer, handle memory yourself. It helps you along the way, however, by having abstractions and language support for memory allocations. Its system of lifetimes, ownership, and borrowing may be familiar to you as concepts from the C++ world. Rust has all of these, not just as concepts but in the language along with compile-time checking, making this most difficult class of runtime problems an easier compile-time problem.
This chapter goes into the details of memory management in Rust. We give a short introduction to LLVM, the compiler framework that the Rust compiler uses, and its Intermediate Representation code.
The topics covered in this chapter are:
- Function variables, stack ...