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

Method page_size

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

Returns the size of a page, in bytes, for this memory. WebAssembly memories are made up of a whole number of pages, so the byte size (as returned by [`Memory::data_size`]) will always be a multiple of their page size. Different Wasm memories may have different page sizes. By default this is 64KiB (aka `0x10000`, `2**16`, `1<<16`, or `65536`) but [the custom-page-sizes proposal] allows opting int

(&self, store: impl AsContext)

Source from the content-addressed store, hash-verified

550 ///
551 /// [the custom-page-sizes proposal]: https://github.com/WebAssembly/custom-page-sizes
552 pub fn page_size(&self, store: impl AsContext) -> u64 {
553 self._page_size(store.as_context().0)
554 }
555
556 pub(crate) fn _page_size(&self, store: &StoreOpaque) -> u64 {
557 self.wasmtime_ty(store).page_size()

Callers 4

_page_sizeMethod · 0.45
_growMethod · 0.45
sizeMethod · 0.45
growMethod · 0.45

Calls 3

_page_sizeMethod · 0.80
as_contextMethod · 0.45
tyMethod · 0.45

Tested by

no test coverage detected