Expand description
Compile-time repr(C) struct layout computation for the v2 runtime.
Given a type definition like type Point { x: number, y: number }, this module
computes the exact byte layout with field offsets as compile-time constants:
#[repr(C)]
struct PointLayout {
header: HeapHeader, // 8 bytes (offset 0)
x: f64, // 8 bytes (offset 8)
y: f64, // 8 bytes (offset 16)
}Field access compiles to a direct load at a known offset: point.x becomes
load f64 [ptr + 8]. No schema lookup, no HashMap, no runtime dispatch.
Structs§
- Struct
Field Layout - Layout information for a single field within a struct.
- Struct
Layout - Complete layout of a
repr(C)struct including its v2 heap header.
Enums§
- Field
Type - Primitive field types with known sizes and alignments.
Constants§
- V2_
HEADER_ ALIGN - Alignment of the v2 heap header.
- V2_
HEADER_ SIZE - Size of the v2 heap header in bytes.
Functions§
- compute_
struct_ layout - Compute the
repr(C)struct layout for a named type with the given fields.