Conversation

😭😭😭 "It turns out that, according to Rust’s rules, leaking memory is completely safe!"
Quote Tweet
We ran into a production memory leak issue with one of our high-throughput Rust systems, check out what we found in my new post on the @onesignal blog: onesignal.com/blog/solving-m #rustlang
3
2
Replying to and
It doesn't mean Rust considers leaking memory correct or that it doesn't make it difficult. It means it doesn't force you to prevent APIs like Rc<T> and Arc<T> from allowing people to leak memory in safe code. If it was considered unsafe, those would have to prevent those cycles.
1
1
Replying to and
Preventing reference cycles would require having very strict type bounds for Rc<T> and Arc<T> to forbid reference counted types nested within reference counted types. Cripples what you can express and would mean you need unsafe code to do something that's type and memory safe.
1
1
Show replies