mozilla/rust — pull request #11399 by huonw (2014-01-08 06:30:32+00:00)
Title: Proof-of-concept garbage collector in std::gc

# Not ready for merging.

## Summary

Mostly conservative non-generational mark-and-sweep task-local GC, with stop-the-task non-incremental collections (i.e. nearly the simplest GC possible, with little effort spent on optimisation). Uses some type information to avoid scanning things like `Gc<[int, .. 10]>` for references to other `Gc<>` pointers.

Includes two new modules `std::{libvec, uniq}` for examples of library defined versions of `~[]` and `~` respectively, which use the rooting API defined in `std::gc` to properly hold references to GC pointers (unlike `~`, `@`, `~[]` and `@[]`). (These modules are mostly demonstrations, not necessarily designed for landing.)

The API is designed so that all the relevant parts can get (or can be adjusted to get) access to type information, to allow for precise scanning (in fact, as hinted above, this is already used).

## Details

For now, in commits & source. I'll write up something more detailed here later.