Garbage Collection for Rust: The Finalizer Frontier
Jacob Hughes, Laurence Tratt
Abstract
Rust is a non-Garbage Collected (GCed) language, but the lack of GC makes expressing data-structures that require shared ownership awkward, inefficient, or both. In this paper we explore a new design for, and implementation of, GC in Rust, called Alloy. Unlike previous approaches to GC in Rust, Alloy allows existing Rust destructors to be automatically used as GC finalizers: this makes Alloy integrate better with existing Rust code than previous solutions but introduces surprising soundness and performance problems. Alloy provides novel solutions for the core problems: finalizer safety analysis rejects unsound destructors from automatically being reused as finalizers; finalizer elision optimises away unnecessary finalizers; and premature finalizer prevention ensures that finalizers are only run when it is provably safe to do so.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext a76658c6-1184-45fc-9c65-e2f632703fbdBuilds on2
- Rethinking Java Performance AnalysisStephen M. Blackburn, Zixian Cai, Rui Chen, Xi Yang et al.ASPLOS 2025 · 19 citations
- Garbage Collection Makes Rust Easier to Use: A Randomized Controlled Trial of the Bronze Garbage CollectorMichael Coblenz, Michelle L. Mazurek, Michael HicksICSE 2022 · 9 citations
Related papers
- How do programmers use unsafe rust?Vytautas Astrauskas, Christoph Matheja, Federico Poli, Peter Müller et al.OOPSLA 2020 · 78 citations
- Aliasing Limits on Translating C to Safe RustMehmet Emre, Peter Boyland, Aesha Parekh, Ryan Schroeder et al.OOPSLA 2023 · 32 citations
- Securing unsafe rust programs with XRustPeiming Liu, Gang Zhao, Jeff HuangICSE 2020 · 28 citations
- Leveraging Rust Types for Program SynthesisJonás Fiala, Shachar Itzhaky, Peter Müller, Nadia Polikarpova et al.PLDI 2023 · 17 citations
- OOM-Guard: Towards Improving the Ergonomics of Rust OOM Handling via a Reservation-Based ApproachChengjun Chen, Zhicong Zhang, Hongliang Tian, Shoumeng Yan et al.FSE 2023 · 2 citations
