3 ms·
Allocation isn’t part of the core language in Rust either, yet it prevents use-after-free generically via RAII
by Ar-Curunir 5y ago
Allocation isn’t part of the core language in Rust either, yet it prevents use-after-free generically via RAII
- yakubin 5y agoCurrently I'm using Rust in a project without RAII. RAII is neither necessary nor sufficient to prevent use-after-free. In Rust use-after-free is prevented by the borrow-checker. In C++ with RAII use-after-free is still possible, because normal references aren't tracked with regard to the lifetime of pointees.
- pjmlp 5y agoMicrosoft and Google are trying to improve it via lifetime analysis, but after 3 years it is still pretty much WIP due to C++ semantics.