summaryrefslogtreecommitdiff
path: root/vendor/github.com/tetratelabs/wazero/config.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2024-08-15 00:08:55 +0000
committerLibravatar GitHub <noreply@github.com>2024-08-15 00:08:55 +0000
commit09f24e044653b1327ac1c40f3ab150e3f0184f23 (patch)
tree1d9984d053fa5c8d1203abaa49b8752a1532ff11 /vendor/github.com/tetratelabs/wazero/config.go
parentupdate go-fastcopy to v1.1.3 (#3200) (diff)
downloadgotosocial-09f24e044653b1327ac1c40f3ab150e3f0184f23.tar.xz
update go-ffmpreg to v0.2.5 (pulls in latest tetratelabs/wazero) (#3203)
Diffstat (limited to 'vendor/github.com/tetratelabs/wazero/config.go')
-rw-r--r--vendor/github.com/tetratelabs/wazero/config.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/vendor/github.com/tetratelabs/wazero/config.go b/vendor/github.com/tetratelabs/wazero/config.go
index d3656849c..ea7b84f44 100644
--- a/vendor/github.com/tetratelabs/wazero/config.go
+++ b/vendor/github.com/tetratelabs/wazero/config.go
@@ -495,7 +495,20 @@ type ModuleConfig interface {
WithFSConfig(FSConfig) ModuleConfig
// WithName configures the module name. Defaults to what was decoded from
- // the name section. Empty string ("") clears any name.
+ // the name section. Duplicate names are not allowed in a single Runtime.
+ //
+ // Calling this with the empty string "" makes the module anonymous.
+ // That is useful when you want to instantiate the same CompiledModule multiple times like below:
+ //
+ // for i := 0; i < N; i++ {
+ // // Instantiate a new Wasm module from the already compiled `compiledWasm` anonymously without a name.
+ // instance, err := r.InstantiateModule(ctx, compiledWasm, wazero.NewModuleConfig().WithName(""))
+ // // ....
+ // }
+ //
+ // See the `concurrent-instantiation` example for a complete usage.
+ //
+ // Non-empty named modules are available for other modules to import by name.
WithName(string) ModuleConfig
// WithStartFunctions configures the functions to call after the module is