Closed tower120 closed 3 years ago
You depend on the fact that struct Arc::Inner::value is first in the Arc::Inner struct. So you never add member-field offset in into_raw / from_raw. https://github.com/tokio-rs/loom/blob/d25c5e3cd23cbbac5e0302833b1056ccf39e2f94/src/sync/arc.rs#L12-L18
Arc::Inner::value
Arc::Inner
Shouldn't Arc::Inner have #[repr(C)] attribute? As far as I know Rust can rearrange field positions at will, with default #repr...
#[repr(C)]
#repr
You are completely correct. Please go ahead and include it in your other PR.
You depend on the fact that struct
Arc::Inner::value
is first in theArc::Inner
struct. So you never add member-field offset in into_raw / from_raw. https://github.com/tokio-rs/loom/blob/d25c5e3cd23cbbac5e0302833b1056ccf39e2f94/src/sync/arc.rs#L12-L18Shouldn't
Arc::Inner
have#[repr(C)]
attribute? As far as I know Rust can rearrange field positions at will, with default#repr
...