4 ms·
> Rust programs, however, won’t leak memory because the compiler makes sure you didn’t write code that could leak memory, and then writes down the parts about f
by thristian 10y ago
> Rust programs, however, won’t leak memory because the compiler makes sure you didn’t write code that could leak memory, and then writes down the parts about freeing memory into the final executable;
A nitpick: Rust doesn't guarantee you won't leak memory, although it makes it much less likely than in C. Leaking memory is actually officially Safe (in the sense of Rust's safe/unsafe division) since it can't cause a program to access not-yet-allocated memory or already-freed memory.
- vvanders 10y agoYup, there's nothing keeping you from having a few RCs around that create a cycle. That said the language does guide you away from things like that much more than C/C++.