Closed radkomih closed 2 years ago
Found what I was looking for.
@radkomih it'd be useful if you posted the solution =P
Sure, here is the fragment with the memory import:
...
importObject := wasmer.NewDefaultWasiImportObject()
memory, _ := wasmer.NewMemory(2, 0)
imports := wasmer.NewImports()
imports.Namespace("env").AppendMemory("memory", memory)
importObject.Extend(*imports)
instance, _ := module.InstantiateWithImportObject(importObject)
...
@james-lawrence
Summary
I don't see any examples in the docs if
wasmer-go
supports importing memory from the host environment into the Wasm module? Is it possible and how?Additional details
For example: The Wasm module (the one below) should be able to use the memory provided by the host and use the host provided functions to manage it.