Fix SharedVectorHeader alignment mismatch on ARM32 platforms #10098
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add explicit 8-byte alignment to SharedVectorHeader on both Rust and C++ sides to fix layout corruption on ARM Cortex-M7 (32-bit).
Without explicit alignment, the struct has 4-byte natural alignment on ARM32, but pointer arithmetic calculations differ between Rust and C++, causing a 4-byte offset when accessing SharedVector data. This corrupts all layout calculations (HorizontalLayout, VerticalLayout, GridLayout) and makes Slint unusable on ARM32 embedded platforms.
The fix adds alignas(8) to C++ and #[repr(C, align(8))] to Rust, ensuring consistent struct layout across the FFI boundary on all platforms.
Fixes: #10097