On 8/5/21 2:12 PM, Miguel Ojeda wrote:
On Wed, Aug 4, 2021 at 8:04 PM Phil Bouchard via Std-Proposals <firstname.lastname@example.org> wrote:Well yeah other than minor compile time fixes that may be needed, if the kernel is recompiled from scratch including all modules then it's all good. It's way better this way than rewriting and testing everything in Rust and way more convenient on the developer's learning curves and work loads.The Linux kernel is not being rewritten in Rust. Furthermore, while memory safety is the key proposition for Rust in the kernel, it is not the only advantage over C. In particular, does your system cover data races or other kinds of UB? What are the runtime costs compared to other approaches?
- The memory manager has the property of being deterministic so no new random race conditions are involved, as such with garbage collector.
- The only drawback is that sizeof(root_ptr) = sizeof(void *) x 4... but can be shrink to sizeof(void *) x 3;
Basically (each being == sizeof(void *)):
- one smart pointer;
- one node pointer to chain them;
- one iterator (or reference);
- one char pointer for debugging but not necessary.
- But it doesn't appear to have much impact in my benchmarks: