News for hackers. Stuff that matters.
Re:Smart pointers for the kernel by dzaima on Thursday October 17, 2024 @11:19PM (#41876080)
nit - Rust does allow memory leaks in safe code. https://doc.rust-lang.org/std/mem/fn.forget.html#safety
Re:Smart pointers for the kernel by eru on Friday October 18, 2024 @01:33AM (#41876601)
Yes, memory leaks are rarer in Rust than in C, but they are an entirely different topic that 'unsafe' blocks.
Re:Smart pointers for the kernel by thayne on Friday October 18, 2024 @03:25AM (#41877088)
It's also possible to leak memory in languages with tracing garbage collection, just create a data structure that holds strong references to objects that are no longer needed, which commonly happens when using something like a HashMap as a cache without any kind of expiration.