Skip to content

Commit

Permalink
Regenerate mach_sys.rs to fix struct field alignments
Browse files Browse the repository at this point in the history
The current 'mach_sys.rs' was generated before rust-bindgen
started translating '#pragma pack(n)' directives into
'#[repr(C, packed(n)]' attributes on the rust struct defintions.
These missing attributes cause debug assertions to fail
because of misaligned access to the fields when serializing
and deserializing the structs for mach_msg calls (see #312).

This PR regenerates the 'mach_sys.rs' file using the
latest bindgen and mach headers from XCode MacOS SDK.
It also introduces padding *before* the 'data size' field
for messages with inline data so that they begin at
8-byte aligned addresses as required by rustc.

Signed-off-by: Mukilan Thiyagarajan <me@mukilan.in>
  • Loading branch information
mukilan committed Jun 23, 2023
1 parent 7f432aa commit 795fddf
Show file tree
Hide file tree
Showing 3 changed files with 41,352 additions and 9,775 deletions.
Loading

0 comments on commit 795fddf

Please sign in to comment.