MCPcopy Create free account
hub / github.com/explodingcamera/tinywasm / set_global_val

Method set_global_val

crates/tinywasm/src/store/mod.rs:288–296  ·  view source on GitHub ↗

Set the global at the actual index in the store

(&mut self, addr: GlobalAddr, value: TinyWasmValue)

Source from the content-addressed store, hash-verified

286
287 /// Set the global at the actual index in the store
288 pub(crate) fn set_global_val(&mut self, addr: GlobalAddr, value: TinyWasmValue) {
289 match self.globals.get_mut(addr as usize) {
290 Some(global) => global.value.set(value),
291 None => {
292 cold_path();
293 unreachable!("global {addr} not found. This should be unreachable")
294 }
295 }
296 }
297}
298
299impl Store {

Callers 2

exec_global_setMethod · 0.80
exec_global_set_32Method · 0.80

Calls 1

setMethod · 0.45

Tested by

no test coverage detected