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

Method grow

crates/c-api/include/wasmtime/memory.hh:70–77  ·  view source on GitHub ↗

Grows the memory by `delta` WebAssembly pages. On success returns the previous size of this memory in units of WebAssembly pages.

Source from the content-addressed store, hash-verified

68 /// On success returns the previous size of this memory in units of
69 /// WebAssembly pages.
70 Result<uint64_t> grow(Store::Context cx, uint64_t delta) const {
71 uint64_t prev = 0;
72 auto *error = wasmtime_memory_grow(cx.ptr, &memory, delta, &prev);
73 if (error != nullptr) {
74 return Error(error);
75 }
76 return prev;
77 }
78
79 /// Returns the size of a page, in bytes, for this memory.
80 ///

Callers

nothing calls this directly

Calls 2

wasmtime_memory_growFunction · 0.85
ErrorClass · 0.70

Tested by

no test coverage detected