* experimental: give listener r/o view of globals Signed-off-by: Thomas Pelletier <thomas@pelletier.codes> * experimental: add global support to interpreter Signed-off-by: Thomas Pelletier <thomas@pelletier.codes> * exp: replace globals proxy with module interface Signed-off-by: Thomas Pelletier <thomas@pelletier.codes> * exp: trim down experimental.InternalModule Signed-off-by: Thomas Pelletier <thomas@pelletier.codes> * Replace globals view slice with constantGlobal Signed-off-by: Thomas Pelletier <thomas@pelletier.codes> * Fix tests after merge Signed-off-by: Thomas Pelletier <thomas@pelletier.codes> * Address PR feedback Signed-off-by: Thomas Pelletier <thomas@pelletier.codes> * Rename methods of experimental.Module Signed-off-by: Thomas Pelletier <thomas@pelletier.codes> * Run make check Signed-off-by: Thomas Pelletier <thomas@pelletier.codes> * Add WazeroOnlyType to constantGlobal Signed-off-by: Thomas Pelletier <thomas@pelletier.codes> --------- Signed-off-by: Thomas Pelletier <thomas@pelletier.codes>
23 lines
607 B
Go
23 lines
607 B
Go
// Package experimental includes features we aren't yet sure about. These are enabled with context.Context keys.
|
|
//
|
|
// Note: All features here may be changed or deleted at any time, so use with caution!
|
|
package experimental
|
|
|
|
import (
|
|
"github.com/tetratelabs/wazero/api"
|
|
)
|
|
|
|
// InternalModule is an api.Module that exposes additional
|
|
// information.
|
|
type InternalModule interface {
|
|
api.Module
|
|
|
|
// NumGlobal returns the count of all globals in the
|
|
// module.
|
|
NumGlobal() int
|
|
|
|
// Global provides a read-only view for a given global
|
|
// index. Panics if idx > GlobalsCount().
|
|
Global(idx int) api.Global
|
|
}
|