Alignment of u64/i64 etc. #197
-
I know that this is part of a much lower layer than this crate but I want to find where the alignment requirements for 64-bit integers are defined for the armv6k platform. I initially thought that Context
I've been getting back into generating IPC bindings, and noticed that some IPC calls (example) have Footnotes |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I think you might have misread the chart you linked, as But for future reference, this file is where the 3DS target spec is implemented in |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
I think you might have misread the chart you linked, as
u64/i64
are equivalent to(unsigned) long long int
and those types are specified to have an 8-byte alignment. You can confirm this yourself by building C program withdevkitARM
using__alignof__
on along long int
, and it will report that the variable has an alignment of 8. So Rust is already doing the right thing here and we absolutely wouldn't want to change that, and I'm pretty sure that you're stuck using#[repr(packed)]
when interfacing with those kind of APIs.But for future reference, this file is where the 3DS target spec is implemented in
rustc
, with thedata_layout
field in particular being where things like integer size an…