macro_rules! for_each_vm_type {
($mac:ident) => { ... };
}Expand description
Invoke the given macro $mac once, passing it the definitions of each of the
VM* types whose layout is shared between the runtime, compilation offsets,
and Cranelift alias regions.
This is a higher-order macro: callers define a macro_rules! macro that
matches the grammar defined below and pass its name as an argument to this
macro’s invocation, e.g. for_each_vm_type!(define_vm_types).
§Grammar
Each type is emitted as a struct definition preceded by:
-
Doc-comment attributes (
#[doc = "..."]). -
An optional
#[derive(...)]attribute. -
A
#[repr(...)]attribute. -
A
#[snake_name = <ident>]attribute giving the type’s name insnake_case, used to generate accessor method names.
Each field may be preceded by doc-comment attributes and, optionally, these marker attributes, in this order:
-
#[aggregate]: this field is a composite (a nested struct or array) rather than a single scalar. Compiled Wasm code accesses such a field’s interior piecewise, so there is no one Cranelift type for the field as a whole and no alias-region accessor is generated for it. The field’s offset is still generated, since that is what interior accesses are computed relative to. -
#[readonly]and/or#[can_move]: describe how Cranelift may treat loads and stores of that field.