Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
mcguire
6y ago
0 comments
Save
Share
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?
0 comments
4 comments · 2 top-level
top
newest
oldest
steveklabnik
6y ago
· 2 in thread
Some people say this, but I think it's misleading; refcounting can make things live longer, but the borrow checker cannot.
Jweb_Guru
6y ago
Well, with ownership, a move can make things "live" longer, I guess.
steveklabnik
6y ago
You're not wrong. I just think there's enough difference that the analogy doesn't really work.
ta20200202
6y ago
RAII for references (pointers) is a no-op. If the cache returns references to the data in its own array there is no overhead.
j
/
k
navigate · click thread line to collapse