4 ms·
It does. You just have to use an Rc/Weak Arc/Weak combination.
by pimeys 7y ago
It does. You just have to use an Rc/Weak Arc/Weak combination.
- hathawsh 7y agoWeak refs are a way to work around reference counting cycles, but cyclic garbage collection is a more complete solution and it's a core feature of nearly every high level language. https://www.php.net/manual/en/features.gc.collecting-cycles.php https://www.php.net/manual/en/features.gc.collecting-cycles.... It seems like people who often use Rust's Rc and Arc will long for some way to implement generic cyclic garbage collection. I don't yet see a way (other than unsafe code), but I may be missing something.