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

Method get_global

crates/tinywasm/src/store/mod.rs:255–263  ·  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

253
254 /// Get the global at the actual index in the store
255 pub(crate) fn get_global(&self, addr: GlobalAddr) -> &GlobalInstance {
256 match self.globals.get(addr as usize) {
257 Some(global) => global,
258 None => {
259 cold_path();
260 unreachable!("global {addr} not found. This should be unreachable")
261 }
262 }
263 }
264
265 /// Get the global at the actual index in the store
266 pub(crate) fn get_global_mut(&mut self, addr: GlobalAddr) -> &mut GlobalInstance {

Callers 3

instanceMethod · 0.80
linkMethod · 0.80
exec_global_set_32Method · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected