mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 02:44:41 +01:00
rust: sync: add Arc::DATA_OFFSET
This constant will be used to expose some offset constants from the Rust Binder driver to tracepoints which are implemented in C. The constant is usually equal to sizeof(refcount_t), but may be larger if T has a large alignment. Signed-off-by: Alice Ryhl <aliceryhl@google.com> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com> Link: https://patch.msgid.link/20251203-binder-trace1-v1-1-22d3ffddb44e@google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0c4ce29612
commit
c1093b8589
1 changed files with 3 additions and 0 deletions
|
|
@ -240,6 +240,9 @@ impl<T> Arc<T> {
|
|||
// `Arc` object.
|
||||
Ok(unsafe { Self::from_inner(inner) })
|
||||
}
|
||||
|
||||
/// The offset that the value is stored at.
|
||||
pub const DATA_OFFSET: usize = core::mem::offset_of!(ArcInner<T>, data);
|
||||
}
|
||||
|
||||
impl<T: ?Sized> Arc<T> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue