3 ms·
Just like a kernel written in C is a big block of assembly code, right? You can isolate any unsafe blocks into small functions, with the smallest scope needed.
by greiskul 11y ago
Just like a kernel written in C is a big block of assembly code, right?
You can isolate any unsafe blocks into small functions, with the smallest scope needed. Same as you would do for asm blocks in C. This is good because it calls attention to what you are doing, when reviewing any code with an unsafe block, you remind yourself to check for these kinds of bugs very carefully, unlike when you are reviewing generic C code where almost every line can have a memory bug.