Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
LinusU
18 days ago
|
parent
|
context
|
favorite
| on:
Zig → Rust porting guide
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( ... ))`
satvikpendem
17 days ago
|
next
[–]
Generally it's automatically dropped unless you go out of your way to use the leak function, which most software doesn't do.
nicoburns
18 days ago
|
prev
[–]
Memory safety doesn't help too much here, but "RAII" (automatically dropping values when they go out of scope) does.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
e.g. `Box::leak(Box::new( ... ))`