5 Working with memory
This chapter covers
- Learning about heap- and stack-based memory management details in Rust
- Understanding Rust’s ownership semantics
- Using reference-counted pointers
- Effectively utilizing smart pointers
- Implementing custom allocators for specific use cases
In chapter 4, we discussed Rust’s data structures, but to complete our understanding, we also need to discuss memory management and how it works with Rust’s data structures. The core data structures provide nice abstractions for managing memory allocation and deallocation, but some applications may require more advanced features that require custom allocators, reference counting, smart pointers, or system-level features that are outside the scope of the Rust language. ...
Get Code Like a Pro in Rust now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.