Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
LinusU
· 6mo ago · 0 comments
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( ... ))`
Comments
[–]
satvikpendem
6mo 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
6mo ago
Memory safety doesn't help too much here, but "RAII" (automatically dropping values when they go out of scope) does.