Skip to content

buffer.alloca.init

← buffer dialect

Create fresh fixed-frame storage initialized with the exact payload bytes. Extent is the payload length, without implicit terminators or alignment padding. Ownership, lifetime, alignment, and backing-pool selection follow buffer.alloca; equal initializers never merge writable allocations. Workgroup initialization is collective: every workitem encounters the same dynamic instance in workgroup-uniform control, and the initialized bytes are visible to the whole workgroup before participants proceed. Other allocatable spaces initialize each invocation's independent storage without collective synchronization.

Operation contract

Property Value
Semantic phase executable
Ownership effects borrow pool (by_value), borrowed result

Signature

Kind Name Type Cardinality Description
Operand pool pool optional Borrowed backing allocation resource.
Result result buffer required Fresh initialized storage root. Produces a fresh allocation.
Attribute base_alignment i64 required Minimum byte alignment of the storage base.
Attribute memory_space enum MemorySpace required Allocatable scratch memory space.
Attribute contents bytes required Exact initial payload bytes.

Examples

%scratch = buffer.alloca.init<private> align(1) utf8("ready") : buffer