Re: [PATCH v6 9/9] rust: sync: atomic: Add Atomic<{usize,isize}>
"Benno Lossin" <[email protected]> Fri, 11 Jul 2025 21:05:34 +0200
| Newsgroups | dev.linux.lists.lkmm,org.kernel.vger.linux-arch,org.kernel.vger.linux-kernel,org.kernel.vger.rust-for-linux |
|---|---|
| Message-ID | <[email protected]> |
On Fri Jul 11, 2025 at 3:45 PM CEST, Miguel Ojeda wrote: > On Fri, Jul 11, 2025 at 11:00 AM Benno Lossin <[email protected]> wrote: >> >> Do we have a static assert with these cfgs that `isize` has the same >> size as these? >> >> If not, then it would probably make sense to add them now. > > Yeah, according to e.g. Matthew et al., we may end up with 128-bit > pointers in the kernel fairly soon (e.g. a decade): > > https://lwn.net/Articles/908026/ > > I rescued part of what I wrote in the old `mod assumptions` which I > never got to send back then -- most of the `static_asserts` are > redundant now that we define directly the types in the `ffi` crate (I > mean, we could still assert that `size_of::<c_char>() == 1` and so on, > but they are essentially a tautology now), so I adapted the comments. > Please see below (draft). Ahhh yes the `mod assumptions` was the thing I remembered! I think it's still useful as a file where we can put other global assumptions as well. --- Cheers, Benno