Re:So You Want to Rust the Linux Kernel?
by fxtentacle on Monday October 11, 2021 @02:35PM
(#28831383)
Depending on the values in b, you could do bit-packing in C++ and munch it down to just 1 byte.
[ Parent
| on HN ]
Re:So You Want to Rust the Linux Kernel?
by zozbot234 on Monday October 11, 2021 @03:43PM
(#28832180)
You can only do bitpacking if individual fields of a struct cannot be accessed via reference (or 'borrowed', in Rust terms). While C/C++ includes the 'register' keyword which forbids reference access, Rust does not.