threads: run ExampleCoreFeaturesThreads on both compiler/interpreter (#2135)

This commit is contained in:
Takeshi Yoneda
2024-03-07 20:53:02 +09:00
committed by GitHub
parent f4b9c01856
commit 687ca2f5ed
2 changed files with 1 additions and 10 deletions

View File

@@ -34,9 +34,7 @@ func ExampleCoreFeaturesThreads() {
ctx := context.Background()
// Threads support must be enabled explicitly in addition to standard V2 features.
// TODO: currently, only the interpreter is supported for snapshotting.
cfg := wazero.NewRuntimeConfigInterpreter().WithCoreFeatures(api.CoreFeaturesV2 | experimental.CoreFeaturesThreads)
cfg := wazero.NewRuntimeConfig().WithCoreFeatures(api.CoreFeaturesV2 | experimental.CoreFeaturesThreads)
r := wazero.NewRuntimeWithConfig(ctx, cfg)
defer r.Close(ctx)

View File

@@ -472,13 +472,6 @@ func (e *engine) compileHostModule(ctx context.Context, module *wasm.Module, lis
func (e *engine) Close() (err error) {
e.mux.Lock()
defer e.mux.Unlock()
for _, cm := range e.compiledModules {
cm.functionOffsets = nil
cm.module = nil
cm.parent = nil
cm.executables = nil
}
e.sortedCompiledModules = nil
e.compiledModules = nil
e.sharedFunctions = nil