3 ms·
That is just using a RefCell under the hood[1] so it is effectively the same trade-offs as the RefCell example from the article. [1]https://docs.rs/gc/0.5.0/sr
by celeritascelery 3y ago
That is just using a RefCell under the hood[1] so it is effectively the same trade-offs as the RefCell example from the article.
[1]https://docs.rs/gc/0.5.0/src/gc/lib.rs.html#495-498 https://docs.rs/gc/0.5.0/src/gc/lib.rs.html#495-498
- paholg 3y agoNote: the two of you are linking to different crates. Samsara provides a Gc type, but it is not the gc crate.
- celeritascelery 3y agoIt looks like you intended to say that on the sibling comment.
- paholg 3y agoYep! Sorry.
- rendaw 3y agoIt doesn't require you to differentiate weak and strong references, so there's no risk of memory leaks due incorrect choice in Gc, unlike Rc IIUC.