r/rust • u/TheProgrammar89 • Jul 26 '19
Is this comment about the reference counting performance in Rust accurate?
/r/ProgrammerHumor/comments/b274zp/oof/eirvecs?context=3
48
Upvotes
r/rust • u/TheProgrammar89 • Jul 26 '19
View all comments
16
u/krappie Jul 26 '19
He seems to be under the impression that there are only 2 options for memory management: Garbage collection, or reference counting. He found references to reference counting in rust, and believes that rust is an entirely reference counted language.
This isn't true of course. He seems to be missing rust's entire ownership model. You only reach for reference counting when the "owner" of the variable is unclear, and it's unclear who will be responsible for cleaning it up.