We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For a struct marked with __attribute__((packed)) -
__attribute__((packed))
typedef struct __attribute__((packed)) { char a; int b; } A;
The layout is as follows (Generated using clang -Xclang -fdump-record-layouts test.c)-
clang -Xclang -fdump-record-layouts test.c
*** Dumping AST Record Layout 0 | A 0 | char a 1 | int b | [sizeof=5, align=1]
Layout without __attribute__((packed))
*** Dumping AST Record Layout 0 | A 0 | char a 4 | int b | [sizeof=8, align=4]
Dart will automatically add relevant padding(so that the int b starts at the 4-byte boundary) If I declare a class A extends ffi.Struct.
int b
class A extends ffi.Struct
There should someway to specify to dart VM how to pack a Struct.
The text was updated successfully, but these errors were encountered:
Duplicate of #38158
Sorry, something went wrong.
No branches or pull requests
For a struct marked with
__attribute__((packed))
-The layout is as follows (Generated using
clang -Xclang -fdump-record-layouts test.c
)-Layout without
__attribute__((packed))
Dart will automatically add relevant padding(so that the
int b
starts at the 4-byte boundary) If I declare aclass A extends ffi.Struct
.There should someway to specify to dart VM how to pack a Struct.
The text was updated successfully, but these errors were encountered: