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

Function NewModuleDeserializeFile

module.go:144–156  ·  view source on GitHub ↗

NewModuleDeserializeFile is the same as `NewModuleDeserialize` except that the bytes are read from a file instead of provided as an argument.

(engine *Engine, path string)

Source from the content-addressed store, hash-verified

142// NewModuleDeserializeFile is the same as `NewModuleDeserialize` except that
143// the bytes are read from a file instead of provided as an argument.
144func NewModuleDeserializeFile(engine *Engine, path string) (*Module, error) {
145 cs := C.CString(path)
146 var ptr *C.wasmtime_module_t
147 err := C.wasmtime_module_deserialize_file(engine.ptr(), cs, &ptr)
148 runtime.KeepAlive(engine)
149 C.free(unsafe.Pointer(cs))
150
151 if err != nil {
152 return nil, mkError(err)
153 }
154
155 return mkModule(ptr), nil
156}

Callers 1

TestModuleSerializeFunction · 0.85

Calls 3

mkErrorFunction · 0.85
mkModuleFunction · 0.85
ptrMethod · 0.45

Tested by 1

TestModuleSerializeFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…