Alphapage opened Issue #1433:
Hello,
I tried this linking example:https://bytecodealliance.github.io/wasmtime/examples-rust-linking.html
I just added a
linking3.wat
file which is a tweaked copy oflinking2.wat
and added(import "linking3" "memory" (memory 1))
tolinking1.wat
.But I get a multiple memories error. Is it the normal behaviour ? Can I only link 2 modules ?
Thank you in advance for your help.
tschneidereit commented on Issue #1433:
cc @alexcrichton
pepyakin commented on Issue #1433:
In the current version of the webassembly spec only one memory per wasm instance is supported, so you basically have three options at the moment:
- module imports memory,
- module exports memory,
- module defines no memory,
there is a pending proposal for lifting this limitation exists: https://github.com/WebAssembly/multi-memory
alexcrichton commented on Issue #1433:
Thanks for the report! Wasmtime at this time doesn't implement the multi-memory proposal (I'm not actually sure of anything that does myself), and as pointed out by @pepyakin we'd need to implement that all first before more than one memory is allowed.
Alphapage commented on Issue #1433:
Sorry, my mistake! I was thinking that
linking1.wat
was using its own memory but it is using the imported one fromlinking2.wat
.
I'm really waiting for multi-memory feature to have dedicated memory to share data between modules using dynamic linking.
Because for now, I think you can't reproduce linking1.wat and linking2.wat in c or rust without corrupting the linear memory which is used to allocate dynamic memory.
Alphapage closed Issue #1433:
Hello,
I tried this linking example:https://bytecodealliance.github.io/wasmtime/examples-rust-linking.html
I just added a
linking3.wat
file which is a tweaked copy oflinking2.wat
and added(import "linking3" "memory" (memory 1))
tolinking1.wat
.But I get a multiple memories error. Is it the normal behaviour ? Can I only link 2 modules ?
Thank you in advance for your help.
Last updated: Dec 23 2024 at 12:05 UTC