I'm trying to polyfill the
AtomicU8::from_mut_slice unstable function in the standard library, and to do it I need to have some equivalent to the
cfg(target_has_atomic_equal_alignment = "n") check.
Even if that is a whitelisted set of platforms where that cfg check will match, how would I find out which platforms have a particular atomic alignment? Or does anybody know which platforms this is safe on somehow?
The compiler sets that by checking the actual alignment of the types:
Those primitive alignments come from the target spec
data_layout per LLVM:
Perfect, and then I can find the data layout by printing the target specification and looking at the
rustc +nightly -Z unstable-options --print target-spec-json --target wasm32-unknown-unknown
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.