Hacker News new | ask | show | jobs
by ChrisSD 2804 days ago
Memory leaks are not only possible but they are officially supported. The most obvious being `std::mem::forget` and `Box::leak`. Of course the user of these functions should usually ensure that drop is eventually called for all initialized data but there's no way to enforce this.

If you mean unintentional leaks then that is a harder problem. Others have noted ARC and RC leaks but also thread locals may (or may not) leak[0].

[0]: https://doc.rust-lang.org/std/thread/struct.LocalKey.html#pl...