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

Method size

crates/wasmtime/src/runtime/memory.rs:531–533  ·  view source on GitHub ↗

Returns the size, in units of pages, of this Wasm memory. WebAssembly memories are made up of a whole number of pages, so the byte size returned will always be a multiple of this memory's page size. Note that different Wasm memories may have different page sizes. You can get a memory's page size via the [`Memory::page_size`] method. By default the page size is 64KiB (aka `0x10000`, `2**16`, `1<<

(&self, store: impl AsContext)

Source from the content-addressed store, hash-verified

529 ///
530 /// Panics if this memory doesn't belong to `store`.
531 pub fn size(&self, store: impl AsContext) -> u64 {
532 self.internal_size(store.as_context().0)
533 }
534
535 pub(crate) fn internal_size(&self, store: &StoreOpaque) -> u64 {
536 let byte_size = self.internal_data_size(store);

Callers 8

computeMethod · 0.45
get_outputMethod · 0.45
register_moduleMethod · 0.45
compile_with_inliningMethod · 0.45
update_sizeMethod · 0.45
fromMethod · 0.45
_serializeMethod · 0.45
relocate_dwarf_sectionsFunction · 0.45

Calls 5

internal_sizeMethod · 0.80
as_contextMethod · 0.45
unwrapMethod · 0.45
data_sizeMethod · 0.45
page_sizeMethod · 0.45

Tested by

no test coverage detected