diff options
Diffstat (limited to 'vendor/github.com/tetratelabs/wazero/experimental')
| -rw-r--r-- | vendor/github.com/tetratelabs/wazero/experimental/compilationworkers.go | 19 | ||||
| -rw-r--r-- | vendor/github.com/tetratelabs/wazero/experimental/features.go | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/vendor/github.com/tetratelabs/wazero/experimental/compilationworkers.go b/vendor/github.com/tetratelabs/wazero/experimental/compilationworkers.go new file mode 100644 index 000000000..bb76e01d3 --- /dev/null +++ b/vendor/github.com/tetratelabs/wazero/experimental/compilationworkers.go @@ -0,0 +1,19 @@ +package experimental + +import ( + "context" + + "github.com/tetratelabs/wazero/internal/expctxkeys" +) + +// WithCompilationWorkers sets the desired number of compilation workers. +func WithCompilationWorkers(ctx context.Context, workers int) context.Context { + return context.WithValue(ctx, expctxkeys.CompilationWorkers{}, workers) +} + +// GetCompilationWorkers returns the desired number of compilation workers. +// The minimum value returned is 1. +func GetCompilationWorkers(ctx context.Context) int { + workers, _ := ctx.Value(expctxkeys.CompilationWorkers{}).(int) + return max(workers, 1) +} diff --git a/vendor/github.com/tetratelabs/wazero/experimental/features.go b/vendor/github.com/tetratelabs/wazero/experimental/features.go index b2a5b9069..a695f149f 100644 --- a/vendor/github.com/tetratelabs/wazero/experimental/features.go +++ b/vendor/github.com/tetratelabs/wazero/experimental/features.go @@ -13,3 +13,6 @@ import "github.com/tetratelabs/wazero/api" // binaries will use a theroetical maximum like 4GB, so if using such a binary on a system // without mmap, consider editing the binary to reduce the max size setting of memory. const CoreFeaturesThreads = api.CoreFeatureSIMD << 1 + +// CoreFeaturesThreads enables tail call instructions ("tail-call"). +const CoreFeaturesTailCall = api.CoreFeatureSIMD << 2 |
