mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2026-04-18 18:18:44 +00:00
Add interpreter commands to get at interpreter specific data.
Signed-off-by: Mic Bowman <mic.bowman@intel.com>
This commit is contained in:
parent
526c52eebf
commit
237c08e0d9
|
|
@ -254,6 +254,19 @@ wasm_runtime_get_exception(wasm_module_inst_t module_inst);
|
|||
void
|
||||
wasm_runtime_clear_exception(wasm_module_inst_t module_inst);
|
||||
|
||||
/**
|
||||
* Save data with the module instance
|
||||
*/
|
||||
bool
|
||||
wasm_runtime_set_instance_data(wasm_module_inst_t module_inst,
|
||||
void *thread_data);
|
||||
|
||||
/**
|
||||
* Retrieve saved instance data
|
||||
*/
|
||||
void*
|
||||
wasm_runtime_get_instance_data(wasm_module_inst_t module_inst);
|
||||
|
||||
/**
|
||||
* Attach the current native thread to a WASM module instance.
|
||||
* A native thread cannot be attached simultaneously to two WASM module
|
||||
|
|
|
|||
|
|
@ -1133,6 +1133,20 @@ wasm_runtime_destroy_exec_env(WASMExecEnv *env)
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
wasm_runtime_set_instance_data(WASMModuleInstance *module_inst,
|
||||
void *thread_data)
|
||||
{
|
||||
module_inst->thread_data = thread_data;
|
||||
return true;
|
||||
}
|
||||
|
||||
void*
|
||||
wasm_runtime_get_instance_data(WASMModuleInstance *module_inst)
|
||||
{
|
||||
return module_inst->thread_data;
|
||||
}
|
||||
|
||||
bool
|
||||
wasm_runtime_attach_current_thread(WASMModuleInstance *module_inst,
|
||||
void *thread_data)
|
||||
|
|
@ -1674,4 +1688,3 @@ wasm_runtime_invoke_native(void *func_ptr, WASMType *func_type,
|
|||
}
|
||||
|
||||
#endif /* end of !defined(__x86_64__) && !defined(__amd_64__) */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user