Module traphandlers

Source
Expand description

WebAssembly trap handling, which is built on top of the lower-level signalhandling mechanisms.

Structsยง

TrapHandlerContext ๐Ÿ”’
Read-only information that is used by signal handlers to handle and recover from traps.
TrapHandlerContextInner ๐Ÿ”’
VMConfig
Configuration for the runtime VM Currently only the stack size is configurable

Enumsยง

UnwindReason ๐Ÿ”’

Constantsยง

TRAP_HANDLER ๐Ÿ”’
YIELDER ๐Ÿ”’

Staticsยง

DEFAULT_STACK_SIZE ๐Ÿ”’
MAGIC ๐Ÿ”’
PREV_SIGBUS ๐Ÿ”’
PREV_SIGFPE ๐Ÿ”’
PREV_SIGILL ๐Ÿ”’
PREV_SIGSEGV ๐Ÿ”’

Functionsยง

catch_trapsโš 
Catches any wasm traps that happen within the execution of closure, returning them as a Result.
get_pc_sp ๐Ÿ”’ โš 
init_traps
This function is required to be called before any WebAssembly is entered. This will configure global state such as signal handlers to prepare the process to receive wasm traps.
lazy_per_thread_init
A module for registering a custom alternate signal stack (sigaltstack).
on_host_stack
When executing on the Wasm stack, temporarily switch back to the host stack to perform an operation that should not be constrainted by the Wasm stack limits.
on_wasm_stack ๐Ÿ”’
Runs the given function on a separate stack so that its stack usage can be bounded. Stack overflows and other traps can be caught and execution returned to the root of the stack.
platform_init ๐Ÿ”’ โš 
process_illegal_op ๐Ÿ”’ โš 
raise_lib_trapโš 
Raises a trap from inside library code immediately.
raise_user_trapโš 
Raises a user-defined trap immediately.
resume_panicโš 
Carries a Rust panic across wasm code and resumes the panic on the other side.
set_stack_size
Default stack size is 1MB.
trap_handler ๐Ÿ”’ โš 
unwind_with ๐Ÿ”’ โš 
update_context ๐Ÿ”’ โš 
wasmer_call_trampolineโš 
Call the wasm function pointed to by callee.

Type Aliasesยง

TrapHandlerFn
Function which may handle custom signals while processing traps.