Adds vs benchmark WasmEdge and splits compile from instantiate (#495)
Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -131,11 +131,16 @@ type CompiledCode struct {
|
||||
compiledEngine wasm.Engine
|
||||
}
|
||||
|
||||
// compile-time check to ensure CompiledCode implements io.Closer (consistent with api.Module)
|
||||
var _ io.Closer = &CompiledCode{}
|
||||
|
||||
// Close releases all the allocated resources for this CompiledCode.
|
||||
//
|
||||
// Note: it is safe to call Close while having outstanding calls from Modules instantiated from this *CompiledCode.
|
||||
func (c *CompiledCode) Close() {
|
||||
// Note: It is safe to call Close while having outstanding calls from Modules instantiated from this *CompiledCode.
|
||||
func (c *CompiledCode) Close() error {
|
||||
c.compiledEngine.DeleteCompiledModule(c.module)
|
||||
// It is possible the underlying may need to return an error later, but in any case this matches api.Module.Close.
|
||||
return nil
|
||||
}
|
||||
|
||||
// ModuleConfig configures resources needed by functions that have low-level interactions with the host operating system.
|
||||
|
||||
Reference in New Issue
Block a user