Hacker News new | ask | show | jobs
by pornel 2527 days ago
`mem::forget()` only prevents destructors from running, which leaks data managed by the destructor as a side effect, but it gives no guarantees about not freeing the object passed to it (e.g. if you call it on a stack-allocated object, it can't leak it).

`Box::leak()` leaks memory.