

8·
3 months agoYou don’t need unsafe. Just keep pushing to a vec and never remove anything. Memory leaks are more than lost memory allocations. You can even have them with rc/arc cycles
You don’t need unsafe. Just keep pushing to a vec and never remove anything. Memory leaks are more than lost memory allocations. You can even have them with rc/arc cycles
Rust doesn’t prevent memory leaks. You can do that in every language
VRR is variable refresh rate. Not sure about the others
You can have a memory leak when items are still in scope in some loop or when you have a reference count cycle. The latter happens with the Rc/Arc types in rust.
An example for the former can be a web server that keeps track of every request it’s ever received in memory. You will eventually run out of memory. But you did not violate any memory rules (dangling pointer, etc.). Memory leaks can be caused by design issues.