Skip to main content

Module layout

Module layout 

Source
Expand description

Struct layout computation for AIR types.

Reimplements LLVM’s StructLayout algorithm for computing field byte offsets, sizes, and alignment. Uses System V AMD64 ABI defaults which cover ~99% of x86-64 C/C++ code.

Functions§

abi_alignment
Returns the ABI alignment in bytes for a type under System V AMD64 rules.
abi_alignment_with_ptr
Returns the ABI alignment in bytes for a type, using the specified pointer width.
align_up 🔒
Round value up to the next multiple of align.
alloc_size
Returns the allocation size in bytes for a type.
alloc_size_with_ptr
Returns the allocation size in bytes for a type, using the specified pointer width.
compute_struct_layout
Computes struct layout: field byte offsets and total size (including tail padding).
compute_struct_layout_with_ptr
Computes struct layout: field byte offsets and total size (including tail padding), using the specified pointer width.