Expand description
WebAssembly trap handling, which is built on top of the lower-level signalhandling mechanisms.
Structsยง
- Trap
Handler ๐Context - Read-only information that is used by signal handlers to handle and recover from traps.
- Trap
Handler ๐Context Inner - VMConfig
- Configuration for the runtime VM Currently only the stack size is configurable
Enumsยง
- Unwind
Reason ๐
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 aResult
. - 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ยง
- Trap
Handler Fn - Function which may handle custom signals while processing traps.