Struct defines the memory layout of a C struct, supporting serialization/deserialization. It works with ffi.ptr to pass data to C functions.
Example
Struct()
StructSchema
size
create()
create().
fromPtr()
fromPtr to read further.
get() / set()
0 / no-op.
Nested Structs
Field values can be anotherStructSchema for recursive layout computation.
With dlopen (HFA register passing)
For small HFA structs passed in registers, pass StructSchema directly as args / returns to dlopen:
fromPtr.
ARM64 Alignment Rules
Nested struct alignment is the maximum alignment of all its fields.