On 13-06-18 12:07 PM, Bill Myers wrote:
For Rc<>, it should be enough to have the GC traverse raw pointers that
have/don't have a special attribute (probably traversing by default is
the best choice), as long as the raw pointers have the correct type.

Obviously it only makes sense to traverse types if it is possible for
them to point to GC pointers.

Oh, oops, yes, of course. I must have been confused writing my previous reply. Currently this should already work: the presence of @ in an Rc<@foo> struct, like in any struct, will cause the Rc<T> part to be considered "managed-unique" and allocated in the local heap, traced-through during collection. This was the first bug I fixed on the path to getting GC working.

You might not _want_ that, if you're using Rc<T> to "avoid GC", but that's up to you to avoid instantiating Rc<@foo>. If you do so, it should automatically participate in GC like any other managed-unique stuff.

-Graydon

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to