Allow overriding max memory on module instantiation (#3198)
This PR adds a max_memory_pages parameter to module instantiation APIs, to allow overriding the max memory defined in the WASM module. Sticking to the max memory defined in the module is quite limiting when using shared memory in production. If targeted devices have different memory constraints, many wasm files have to be generated with different max memory values. And device constraints may not be known in advance. Being able to set the max memory value during module instantiation allows to reuse the same wasm module, e.g. by retrying instantiation with different max memory value.
This commit is contained in:
@ -513,7 +513,8 @@ wasm_unload(WASMModule *module);
|
||||
WASMModuleInstance *
|
||||
wasm_instantiate(WASMModule *module, WASMModuleInstance *parent,
|
||||
WASMExecEnv *exec_env_main, uint32 stack_size,
|
||||
uint32 heap_size, char *error_buf, uint32 error_buf_size);
|
||||
uint32 heap_size, uint32 max_memory_pages, char *error_buf,
|
||||
uint32 error_buf_size);
|
||||
|
||||
void
|
||||
wasm_dump_perf_profiling(const WASMModuleInstance *module_inst);
|
||||
|
||||
Reference in New Issue
Block a user