Reduces exports and prepares ReleaseModuleInstance for testing (#327)

This removes more exports and adds a toehold test for
`ReleaseModuleInstance` so that it can later be completed for both
wasm and host modules.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
Crypt Keeper
2022-03-04 08:55:49 +08:00
committed by GitHub
parent 5cee2d8e25
commit aa61087016
9 changed files with 251 additions and 206 deletions

View File

@@ -2,6 +2,7 @@ package wazero
import (
"bytes"
"context"
"errors"
internalwasm "github.com/tetratelabs/wazero/internal/wasm"
@@ -66,6 +67,7 @@ func NewRuntime() Runtime {
// NewRuntimeWithConfig returns a runtime with the given configuration.
func NewRuntimeWithConfig(config *RuntimeConfig) Runtime {
return &runtime{
ctx: config.ctx,
store: internalwasm.NewStore(config.ctx, config.engine, config.enabledFeatures),
enabledFeatures: config.enabledFeatures,
}
@@ -73,6 +75,7 @@ func NewRuntimeWithConfig(config *RuntimeConfig) Runtime {
// runtime allows decoupling of public interfaces from internal representation.
type runtime struct {
ctx context.Context
store *internalwasm.Store
enabledFeatures internalwasm.Features
}