Skip to content

buffer.constant

← buffer dialect

Borrow anonymous immutable executable storage containing the exact payload bytes. Evaluation performs no per-invocation allocation or initialization. Equal contents may share storage, with no distinct address identity guarantee. The byte extent excludes alignment padding; UTF-8 adds no terminator or normalization. Empty payloads produce a nonnull zero-length buffer. Omitted alignment means one byte. Named objects with identity or linkage requirements use global.rodata.def.

Operation contract

Property Value
Semantic phase executable
Traits Pure, ConstantLike

Signature

Kind Name Type Cardinality Description
Result result buffer required Borrowed readonly storage root.
Attribute contents bytes required Exact immutable payload bytes.
Attribute alignment i64 optional Minimum power-of-two byte alignment, defaulting to one.

Examples

%message = buffer.constant utf8("ready") : buffer