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

Function NewEngineWithConfig

engine.go:29–40  ·  view source on GitHub ↗

NewEngineWithConfig creates a new `Engine` with the `Config` provided Note that once a `Config` is passed to this method it cannot be used again.

(config *Config)

Source from the content-addressed store, hash-verified

27//
28// Note that once a `Config` is passed to this method it cannot be used again.
29func NewEngineWithConfig(config *Config) *Engine {
30 if config.ptr() == nil {
31 panic("config already used")
32 }
33 engine := &Engine{_ptr: C.wasm_engine_new_with_config(config.ptr())}
34 runtime.SetFinalizer(config, nil)
35 config._ptr = nil
36 runtime.SetFinalizer(engine, func(engine *Engine) {
37 engine.Close()
38 })
39 return engine
40}
41
42// Close will deallocate this engine's state explicitly.
43//

Callers 7

newComponentEngineFunction · 0.85
refTypesStoreFunction · 0.85
TestInterruptWasmFunction · 0.85
TestAddFuelFunction · 0.85
TestEngineFunction · 0.85
multiMemoryStoreFunction · 0.85

Calls 2

CloseMethod · 0.95
ptrMethod · 0.45

Tested by 7

newComponentEngineFunction · 0.68
refTypesStoreFunction · 0.68
TestInterruptWasmFunction · 0.68
TestAddFuelFunction · 0.68
TestEngineFunction · 0.68
multiMemoryStoreFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…