MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime-go / NewTrap

Function NewTrap

trap.go:58–62  ·  view source on GitHub ↗

NewTrap creates a new `Trap` with the `name` and the type provided.

(message string)

Source from the content-addressed store, hash-verified

56
57// NewTrap creates a new `Trap` with the `name` and the type provided.
58func NewTrap(message string) *Trap {
59 ptr := C.wasmtime_trap_new(C._GoStringPtr(message), C._GoStringLen(message))
60 runtime.KeepAlive(message)
61 return mkTrap(ptr)
62}
63
64func mkTrap(ptr *C.wasm_trap_t) *Trap {
65 trap := &Trap{_ptr: ptr}

Callers 5

TestTrapFunction · 0.85
TestFuncTrapFunction · 0.85
TestFuncWrapRetErrorTrapFunction · 0.85
goTrampolineNewFunction · 0.85
goTrampolineWrapFunction · 0.85

Calls 1

mkTrapFunction · 0.85

Tested by 3

TestTrapFunction · 0.68
TestFuncTrapFunction · 0.68
TestFuncWrapRetErrorTrapFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…