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

Method get_global_val

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

Get the global at the actual index in the store

(&self, addr: GlobalAddr)

Source from the content-addressed store, hash-verified

275
276 /// Get the global at the actual index in the store
277 pub(crate) fn get_global_val(&self, addr: GlobalAddr) -> TinyWasmValue {
278 match self.globals.get(addr as usize) {
279 Some(global) => global.value.get(),
280 None => {
281 cold_path();
282 unreachable!("global {addr} not found. This should be unreachable")
283 }
284 }
285 }
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) {

Callers 1

exec_global_getMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected