MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / sizeof

Method sizeof

winch/codegen/src/stack.rs:471–479  ·  view source on GitHub ↗

Calculates the size of, in bytes, of the top n [Memory] entries in the value stack.

(&self, top: usize)

Source from the content-addressed store, hash-verified

469 /// Calculates the size of, in bytes, of the top n [Memory] entries
470 /// in the value stack.
471 pub fn sizeof(&self, top: usize) -> u32 {
472 self.peekn(top).fold(0, |acc, v| {
473 if v.is_mem() {
474 acc + v.unwrap_mem().slot.size
475 } else {
476 acc
477 }
478 })
479 }
480}
481
482#[cfg(test)]

Callers 1

visit_br_ifMethod · 0.45

Calls 3

unwrap_memMethod · 0.80
peeknMethod · 0.45
is_memMethod · 0.45

Tested by

no test coverage detected