wasm-micro-runtime
wasm-micro-runtime copied to clipboard
Support importing memory & table
Does this project have any plan to implement supports for importing memories and tables when instantiating a WebAssembly Instance?
Besides, any plan to implement the grow
method of memories and tables?
Currently, We prefer the below strategies for safety:
- not to use host created memory and table
- not to grow internal memory and table
@lum1n0us Can you clarify your answer?
I also need to import the table and memory from a different module in an instantiation of a different module. Is there a way to achieve this? Will there ever be one?
Thanks!
Unfortunately, there is no way to achieve that for now. Every module has to stick with its own table and memory for now in WAMR.
- not to grow internal memory and table
@lum1n0us What safety concerns are involved with growing Memory and Table?
WAMR actually doesn't want host functions linking "host-made" tables and memories. Worries of growing are related to WAMR memory model. WAMR will help .wasm modules to save their memory consumption and might have a few differences with the linear memory in users' minds.
@lum1n0us In my case, my memory and table isn’t host-made. They’re simply imported from another module.
That is the point. As a runtime, it can't tell an imported memory or table(in imports
of wasm_instance_new()
) comes from wasm_memory_new
and wasm_table_new
or from another module.
Currently, We prefer the below strategies for safety:
* not to use host created memory and table * not to grow internal memory and table
i'm not sure if i understand the "safety" argument. it's just a lack of functionality.