News for hackers. Stuff that matters.
Re:Rust: Dropping heavy things in another thread can make yo... by mcguire on Saturday May 30, 2020 @03:42PM (#23363962)
Apparently, that doesn't work in Rust: https://news.ycombinator.com/item?id=23363647
Re:Rust: Dropping heavy things in another thread can make yo... by the8472 on Saturday May 30, 2020 @04:11PM (#23364228)
It does work in rust. you just cannot rely on Drop for memory-safety. If you mem::forget a struct that holds onto some other resource then all that means is that you're committing that resource to the lifetime of the process. We usually call that a leak but it can be intentional.
Re:Rust: Dropping heavy things in another thread can make yo... by the_why_of_y on Sunday May 31, 2020 @04:37AM (#23368138)
By that argument, it doesn't work in C++ either because std::unique_ptr::release() exists.