mirror of
https://gitee.com/openharmony/third_party_rust_bindgen
synced 2025-01-18 21:22:38 +00:00
9a2ce1ca6e
Before repr(align), we could only safely guarantee up to 8-bytes of alignment (I think the pointer-width check is a more conservative way of doing that, in practice, because I _think_ u64 is 8-byte aligned even for smaller targets). So when we may generate a potentially-under-aligned struct, we always used to pad it so as to guarantee that at least the size (and thus reads from rust for C-allocated structs) was fine. But if we support repr(align), then the above is always unneeded.