Garbage Collection Without Unsafe Code
Summary
The article introduces safe-gc, a Rust garbage collector implemented with zero unsafe code. It explains the API (Gc<T>, Root<T>, Trace) and the architecture (Heap, Arena, RootSet), and discusses design trade-offs, including a look at a copying collector and reasons for choosing a mark-and-sweep approach for heterogeneous objects. It emphasizes safety benefits of avoiding unsafe blocks and outlines potential footguns and safeguards.