3 ms·
Actually, memory leaks are the major class of memory error for which Rust offers no protection. See the following safe function in Box: https://doc.rust-lang.o
by James_K 1y ago
Actually, memory leaks are the major class of memory error for which Rust offers no protection. See the following safe function in Box:
https://doc.rust-lang.org/std/boxed/struct.Box.html#method.leak https://doc.rust-lang.org/std/boxed/struct.Box.html#method.l...
- gizmo686 1y agoRust's memory safety guarantees do not insure the absence of leaks. However, Rust's design does offer significant protection against leaks (relative to languages like C where all heap allocations must be explicitly freed). The fact that any felt it nessasary to add a "leak" function to the standard library should tell you something about how easy it is to accidentally leak memory.