2 ms·
Pointer ownership is the most important feature of Rust, and everything is built around it. The management of memory, auto-freeing of resources (a mutex unlocks
by keeperofdakeys 12y ago
Pointer ownership is the most important feature of Rust, and everything is built around it. The management of memory, auto-freeing of resources (a mutex unlocks simply when it goes out of scope). It also ensures that no piece of memory has more than one pointer which is mutable at any one time, allowing many optimisations that const in C++ does, but without actually having to annotate all your variables. You can also guarantee that a new thread shares no memory with another thread, preventing many types of race conditions. Goodbye to memory leaks, goodbye to buffer overflows, goodbye to use-after-free, goodbye to null pointer crashes.