Skip to content
Better HN
Top
Best
Ask
Show
New
Jobs
Search
⌘K
0 points
LinusU
1mo ago
0 comments
Save
Share
Memory safety has nothing to do with memory leaks, and it's perfectly valid to leak memory in Rust?
e.g. `Box::leak(Box::new( ... ))`
0 comments
2 comments · 2 top-level
top
newest
oldest
satvikpendem
1mo ago
Generally it's automatically dropped unless you go out of your way to use the leak function, which most software doesn't do.
nicoburns
1mo ago
Memory safety doesn't help too much here, but "RAII" (automatically dropping values when they go out of scope) does.
j
/
k
navigate · click thread line to collapse