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

Method Close

engine.go:57–65  ·  view source on GitHub ↗

Close will deallocate this engine's state explicitly. By default state is cleaned up automatically when an engine is garbage collected but the Go GC. The Go GC, however, does not provide strict guarantees about finalizers especially in terms of timing. Additionally the Go GC is not aware of the ful

()

Source from the content-addressed store, hash-verified

55// Close can be called multiple times without error. Only the first time will
56// deallocate resources.
57func (engine *Engine) Close() {
58 if engine._ptr == nil {
59 return
60 }
61 runtime.SetFinalizer(engine, nil)
62 C.wasm_engine_delete(engine.ptr())
63 engine._ptr = nil
64
65}
66
67func (engine *Engine) ptr() *C.wasm_engine_t {
68 ret := engine._ptr

Callers 4

NewEngineFunction · 0.95
NewEngineWithConfigFunction · 0.95
TestStoreFunction · 0.95
TestEngineFunction · 0.95

Calls 1

ptrMethod · 0.95

Tested by 2

TestStoreFunction · 0.76
TestEngineFunction · 0.76