3 ms·
On the other hand, Rust's RAII management model behaves similarly to a reference counting system where the counts are limited to 0 and 1 (well, for a loose appr
by mcguire 7y ago
On the other hand, Rust's RAII management model behaves similarly to a reference counting system where the counts are limited to 0 and 1 (well, for a loose approximation of the 0 state), right?
- steveklabnik 7y agoSome people say this, but I think it's misleading; refcounting can make things live longer, but the borrow checker cannot.
- Jweb_Guru 7y agoWell, with ownership, a move can make things "live" longer, I guess.
- steveklabnik 7y agoYou're not wrong. I just think there's enough difference that the analogy doesn't really work.
- ta20200202 7y agoRAII for references (pointers) is a no-op. If the cache returns references to the data in its own array there is no overhead.