Re:Why did we choose Rust to develop TiKV?
by stepik777 on Wednesday September 27, 2017 @07:11AM
(#15346606)
And how would smart pointers help you if you need to return pointer to a member from a function? Does C++ protects you from moved from unique_ptr? Or from iterator invalidation? Or maybe you can safely use non-atomic shared pointer if you don't need to send it across threads?
[ Parent
| on HN ]
Re:Why did we choose Rust to develop TiKV?
by duneroadrunner on Wednesday September 27, 2017 @08:38AM
(#15347141)
While "just enforcing `make_shared`" wouldn't solve all the memory safety issues, it actually can be somewhat practical to "just avoid using any (or most) C++ elements that can access invalid (or uninitialized) memory", instead using the safe, compatible substitutes in the SaferCPlusPlus[1] library.
[1] shameless plug: https://github.com/duneroadrunner/SaferCPlusPlus