3 ms·
I've written utility programs that never bother to deallocate memory because the program needs all of it until the point where it exits anyhow.
by t43562 1y ago
I've written utility programs that never bother to deallocate memory because the program needs all of it until the point where it exits anyhow.
- estebank 1y agoYou can do the same in Rust with Box::leak, which takes an owned pointer and gives you back a 'static borrow. The only caveat is that unless you reconstitute the type its Drop impl won't be called, but that's likely exactly what you wanted.