Published March 31, 2025
| Version v1
Conference paper
Breadth-first Cycle Collection Reference Counting: Theory and a Rust Smart Pointer Implementation
Creators
Contributors
Others:
- Alma Mater Studiorum Università di Bologna = University of Bologna (UNIBO)
- Fondements opérationnels, logiques et algébriques des systèmes logiciels (OLAS) ; Centre Inria d'Université Côte d'Azur (CRISAM) ; Institut National de Recherche en Informatique et en Automatique (Inria)-Institut National de Recherche en Informatique et en Automatique (Inria)-Dipartimento di Informatica - Scienza e Ingegneria [Bologna] (DISI) ; Alma Mater Studiorum Università di Bologna = University of Bologna (UNIBO)-Alma Mater Studiorum Università di Bologna = University of Bologna (UNIBO)
Description
We present a new garbage collection reference counting algorithm capable of collecting reference cycles-overcoming a known limitation of traditional reference counting. The algorithm's key features include resilience to errors during tracing, support for object finalisation, no need for supplementary heap memory during collection, and a fast breadth-first tracing approach that avoids stack overflows. We implement the algorithm as a Rust library that is idiomatic and highly compatible with the Rust ecosystem and that leverages Rust's type system and borrow checker to minimise unsafe code and prevent undefined behaviour. We report benchmarks that show that our proposal performs comparably to popular Rust alternatives and outperforms them when dealing with garbage cycles.
Abstract
International audienceAdditional details
Identifiers
- URL
- https://hal.science/hal-04887627
- URN
- urn:oai:HAL:hal-04887627v1
Origin repository
- Origin repository
- UNICA