pub struct WasmGlobal {
pub index: u32,
pub init: Option<GlobalInit>,
pub mutable: bool,
pub slot_bytes: u32,
}Expand description
A WASM global’s declaration — its initial value and mutability (#237).
Needed so the native-pointer ABI can recognize a global whose initializer is
a linear-memory address (e.g. $__stack_pointer = 65536) and make it
__synth_wasm_data-relative, rather than reading it from an R9 globals table
the self-contained drop-in object can’t rely on.
Fields§
§index: u32Global index (defined globals; imported globals are not counted here).
init: Option<GlobalInit>The captured constant initializer (#237/#649): i32.const or
i64.const. Float/non-const init exprs decode to None — see
GlobalInit.
mutable: boolWhether the global is mutable.
slot_bytes: u32#643: byte width of the global’s storage slot, from its declared value
type — 4 for i32/f32, 8 for i64/f64, 16 for v128. The globals table is
laid out by SUMMING these widths (not index * 4): an i64 global needs
room for both words, and every later global’s offset shifts with it.
Trait Implementations§
Source§impl Clone for WasmGlobal
impl Clone for WasmGlobal
Source§fn clone(&self) -> WasmGlobal
fn clone(&self) -> WasmGlobal
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more