[rust-dev] purely function red-black tree

Patrick Walton pwalton at mozilla.com
Sat Dec 15 19:20:04 PST 2012


On 12/15/12 7:15 PM, Patrick Walton wrote:
> However, if you modify the algorithm to use unique pointers throughout,
> then your methods like get() can probably return a borrowed pointer
> instead.

To add: For anyone interested in making data structures that don't use 
the garbage collector, look at the manually-memory-managed map here:

https://github.com/mozilla/rust/blob/master/src/libcore/send_map.rs

It's probably the best example of a GC-free data structure so far.

Patrick



More information about the Rust-dev mailing list