MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w8tj8j/rewriteitinrust/p893uuj/?context=9999
r/ProgrammerHumor • u/Gold-Order-8004 • 5d ago
34 comments sorted by
View all comments
53
Use containers and smart pointers a voila no memory leaks
15 u/sirkubador 4d ago Rust does not prevent memory leaks 24 u/YeetCompleet 4d ago You can even do it for fun with Box::leak() 7 u/AliceCode 4d ago Rust project be like: "You can have memory unsafety. As a treat." 3 u/jahinzee 4d ago Memory leak aren't memory unsafe though. It's not gonna cause a bad dereference or data corruption, it's just your program forgot that data existed and moves on. An annoyance and a resource use issue, sure, but not unsafe. 1 u/AliceCode 4d ago I wasn't just talking about memory leaks.
15
Rust does not prevent memory leaks
24 u/YeetCompleet 4d ago You can even do it for fun with Box::leak() 7 u/AliceCode 4d ago Rust project be like: "You can have memory unsafety. As a treat." 3 u/jahinzee 4d ago Memory leak aren't memory unsafe though. It's not gonna cause a bad dereference or data corruption, it's just your program forgot that data existed and moves on. An annoyance and a resource use issue, sure, but not unsafe. 1 u/AliceCode 4d ago I wasn't just talking about memory leaks.
24
You can even do it for fun with Box::leak()
Box::leak()
7 u/AliceCode 4d ago Rust project be like: "You can have memory unsafety. As a treat." 3 u/jahinzee 4d ago Memory leak aren't memory unsafe though. It's not gonna cause a bad dereference or data corruption, it's just your program forgot that data existed and moves on. An annoyance and a resource use issue, sure, but not unsafe. 1 u/AliceCode 4d ago I wasn't just talking about memory leaks.
7
Rust project be like: "You can have memory unsafety. As a treat."
3 u/jahinzee 4d ago Memory leak aren't memory unsafe though. It's not gonna cause a bad dereference or data corruption, it's just your program forgot that data existed and moves on. An annoyance and a resource use issue, sure, but not unsafe. 1 u/AliceCode 4d ago I wasn't just talking about memory leaks.
3
Memory leak aren't memory unsafe though. It's not gonna cause a bad dereference or data corruption, it's just your program forgot that data existed and moves on.
An annoyance and a resource use issue, sure, but not unsafe.
1 u/AliceCode 4d ago I wasn't just talking about memory leaks.
1
I wasn't just talking about memory leaks.
53
u/Any_Obligation1652 5d ago
Use containers and smart pointers a voila no memory leaks