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)
| 142 | // NewModuleDeserializeFile is the same as `NewModuleDeserialize` except that |
| 143 | // the bytes are read from a file instead of provided as an argument. |
| 144 | func 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 | } |
searching dependent graphs…