mirror of
https://github.com/torvalds/linux.git
synced 2026-10-25 08:16:03 +01:00
Implement a `transmute/safe_transmute` that checks size at monomorphization time instead of type-checking time. This allows more cases where we know that the size matches but this is not generically checkable. The signature is equivalent to the unstable `transmute_neo` function in the standard library. A safe variant is provided to use with types implementing `FromBytes` and `IntoBytes`. Existing users of `transmute_copy` to bypass size checks are converted. Signed-off-by: Gary Guo <gary@garyguo.net> Reviewed-by: Alexandre Courbot <acourbot@nvidia.com> Tested-by: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Miguel Ojeda <ojeda@kernel.org> Link: https://patch.msgid.link/20260901-typed_register-v4-2-5552b1d59525@garyguo.net [ Fix doc heading to use plural "Examples", add missing closing code block delimiter and fix a few other nits. - Danilo ] Signed-off-by: Danilo Krummrich <dakr@kernel.org> |
||
|---|---|---|
| .. | ||
| arc | ||
| atomic | ||
| lock | ||
| arc.rs | ||
| aref.rs | ||
| atomic.rs | ||
| barrier.rs | ||
| completion.rs | ||
| condvar.rs | ||
| lock.rs | ||
| locked_by.rs | ||
| poll.rs | ||
| rcu.rs | ||
| refcount.rs | ||
| set_once.rs | ||
| srcu.rs | ||