3 ms·
Rust is capable of eliminating unnecessary count increments and decrements for Rc fairly often. The compiler doesn't usually need specific knowledge -- if there
by dataangel 4y ago
Rust is capable of eliminating unnecessary count increments and decrements for Rc fairly often. The compiler doesn't usually need specific knowledge -- if there is a +1 and then a -1 LLVM is smart enough to cancel that out on its own. I'd actually be curious to see examples where it doesn't.
- pjmlp 4y agoMe too, because that is the usual hoping the compiler does the right thing, tied to LLVM, and not part of language semantics.