mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 06:55:07 +00:00
Expose wasm_runtime_get_exec_env_singleton to the API users (#1388)
Sometimes it can be useful to access the singleton. E.g. use wasm_runtime_set_user_data on it.
This commit is contained in:
parent
6caa6b1d73
commit
12931e7f59
|
@ -592,7 +592,8 @@ wasm_runtime_call_indirect(WASMExecEnv *exec_env, uint32 element_indices,
|
|||
bool
|
||||
wasm_runtime_create_exec_env_singleton(WASMModuleInstanceCommon *module_inst);
|
||||
|
||||
WASMExecEnv *
|
||||
/* See wasm_export.h for description */
|
||||
WASM_RUNTIME_API_EXTERN WASMExecEnv *
|
||||
wasm_runtime_get_exec_env_singleton(WASMModuleInstanceCommon *module_inst);
|
||||
|
||||
/* See wasm_export.h for description */
|
||||
|
|
|
@ -485,6 +485,23 @@ wasm_runtime_create_exec_env(wasm_module_inst_t module_inst,
|
|||
WASM_RUNTIME_API_EXTERN void
|
||||
wasm_runtime_destroy_exec_env(wasm_exec_env_t exec_env);
|
||||
|
||||
/**
|
||||
* Get the singleton execution environment for the instance.
|
||||
*
|
||||
* Note: The singleton execution environment is the execution
|
||||
* environment used internally by the runtime for the API functions
|
||||
* like wasm_application_execute_main, which don't take explicit
|
||||
* execution environment. It's associated to the corresponding
|
||||
* module instance and managed by the runtime. The API user should
|
||||
* not destroy it with wasm_runtime_destroy_exec_env.
|
||||
*
|
||||
* @param module_inst the module instance
|
||||
*
|
||||
* @return exec_env the execution environment to destroy
|
||||
*/
|
||||
WASM_RUNTIME_API_EXTERN wasm_exec_env_t
|
||||
wasm_runtime_get_exec_env_singleton(wasm_module_inst_t module_inst);
|
||||
|
||||
/**
|
||||
* Start debug instance based on given execution environment.
|
||||
* Note:
|
||||
|
|
Loading…
Reference in New Issue
Block a user