Disable aux stack allocations for threads spawned by wasi_thread_start (#1867)
This syscall doesn't need allocating stack or TLS and it's expected from the application to do that instead. E.g. WASI-libc already does this for `pthread_create`. Also fix some of the examples to allocate memory for stack and not use stack before the stack pointer is set to a correct value.
This commit is contained in:
@ -179,6 +179,13 @@ wasm_exec_env_create(struct WASMModuleInstanceCommon *module_inst,
|
||||
void
|
||||
wasm_exec_env_destroy(WASMExecEnv *exec_env);
|
||||
|
||||
static inline bool
|
||||
wasm_exec_env_is_aux_stack_managed_by_runtime(WASMExecEnv *exec_env)
|
||||
{
|
||||
return exec_env->aux_stack_boundary.boundary != 0
|
||||
|| exec_env->aux_stack_bottom.bottom != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate a WASM frame from the WASM stack.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user