summaryrefslogtreecommitdiff
path: root/vendor/github.com/tetratelabs/wazero/api/wasm.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/tetratelabs/wazero/api/wasm.go')
-rw-r--r--vendor/github.com/tetratelabs/wazero/api/wasm.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/vendor/github.com/tetratelabs/wazero/api/wasm.go b/vendor/github.com/tetratelabs/wazero/api/wasm.go
index c66b582fa..d99c1a756 100644
--- a/vendor/github.com/tetratelabs/wazero/api/wasm.go
+++ b/vendor/github.com/tetratelabs/wazero/api/wasm.go
@@ -151,9 +151,13 @@ type Module interface {
// ExportedFunction returns a function exported from this module or nil if it wasn't.
//
- // Note: The default wazero.ModuleConfig attempts to invoke `_start`, which
- // in rare cases can close the module. When in doubt, check IsClosed prior
- // to invoking a function export after instantiation.
+ // # Notes
+ // - The default wazero.ModuleConfig attempts to invoke `_start`, which
+ // in rare cases can close the module. When in doubt, check IsClosed prior
+ // to invoking a function export after instantiation.
+ // - The semantics of host functions assumes the existence of an "importing module" because, for example, the host function needs access to
+ // the memory of the importing module. Therefore, direct use of ExportedFunction is forbidden for host modules.
+ // Practically speaking, it is usually meaningless to directly call a host function from Go code as it is already somewhere in Go code.
ExportedFunction(name string) Function
// ExportedFunctionDefinitions returns all the exported function