2 ms·
I tend to think of the way Rust does memory management as a compile-time equivalent to garbage collection. Instead of figuring out at runtime when to free memor
by saghm 4y ago
I tend to think of the way Rust does memory management as a compile-time equivalent to garbage collection. Instead of figuring out at runtime when to free memory, the compiler instead determines when allocations can be freed and puts in the calls to free itself. The key difference between this and manually calling malloc/free is that Rust makes use after free a compiler error instead of undefined behavior at runtime.