[rust-dev] Incremental and generational GC
pwalton at mozilla.com
Thu Jul 11 11:25:23 PDT 2013
OK, after talking with Felix and Niko (thanks!) here's a proposal.
* Whenever we borrow an `@mut` to `&mut`, add it to a "borrowed set" for
the duration of the borrow.
* Objects in the borrowed set are grayed before each incremental GC slice.
* Objects in the borrowed set are scanned during each minor collection,
even if they're tenured.
* When removing an object from the borrowed set (because the borrowed is
done), add it to a remembered set. Objects in the remembered set are
scanned during minor collections.
* There are no other write barriers.
I believe (although I haven't thought about it too hard) that this
suffices to make generational and incremental GC work in Rust's
More information about the Rust-dev