3 ms·
Except unsafe blocks are rare and heavily marked as "this is where the unsafeness is".
by monocasa 6y ago
Except unsafe blocks are rare and heavily marked as "this is where the unsafeness is".
- pml1 6y agoIt won't be rare in driver code.
- monocasa 6y agoIt absolutely will, particularly in USB code. USB devices other than host controllers don't have memory mapped registers for instance, it's basically a network protocol.
- ComputerGuru 6y agoI’ve written bare metal code for rust that does networking and had only a handful of `unsafe` usages, and none after startup/init was completed. It’s actually really incredible how far “simple” shared-read-vs-exclusive-write bound checking and a very strict (but capable/likely Turing complete) type system can take you.