wasmi-labs / wasmi

WebAssembly (Wasm) interpreter.
https://wasmi-labs.github.io/wasmi/
Apache License 2.0
1.56k stars 281 forks source link

Implement the Wasm `custom-page-sizes` proposal #1197

Open Robbepop opened 1 week ago

Robbepop commented 1 week ago

This is about adding support for the custom-page-sizes Wasm proposal.

The custom-page-sizes Wasm proposal has been recently moved to Phase 3 and is moving forward quickly thus stabilization can be expected to happen soon.

Having custom-page-sizes support in Wasmi will be an enabler (in parts) for using Wasmi in even more embedded environments where memory usage is particularly constrained. Not every embedded environment can afford 64kB worth of linear memory for a single Wasm page.

Robbepop commented 1 day ago

Wasmtime introduced the MemoryTypeBuilder in order to set the various properties of a Wasm memory defined on the host side. Since Wasmi tries to implement the Wasmtime API for its users we should introduce the same API even though Wasmi's memory type isn't as complicated, yet.

Link: https://docs.rs/wasmtime/25.0.1/wasmtime/struct.MemoryTypeBuilder.html