wasmtime

package
v0.4.7-rc7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MaxMemorySize = 32 * 1024 * 1024
)

Variables

This section is empty.

Functions

func NewWASMTimeRuntime

func NewWASMTimeRuntime(ctx context.Context, logger types.Logger, code []byte, apis *types.HostAPIRegistry) (out types.AspectRuntime, err error)

func Wrap

func Wrap(api *types.HostAPIRegistry, module types.Module, ns types.NameSpace, method types.MethodName,
	hostFunc *types.HostFuncWithGasRule) (interface{}, error)

Types

type Context

type Context struct {
	context.Context

	// memory *Memory
	Instance *wasmtime.Instance
	Store    *wasmtime.Store
	// contains filtered or unexported fields
}

func NewContext

func NewContext(ctx context.Context, logger types.Logger) *Context

func (*Context) AddEVMGas

func (c *Context) AddEVMGas(gas int64) error

func (*Context) AllocMemory

func (c *Context) AllocMemory(size int32) (int32, error)

func (*Context) ConsumeWASMGas

func (c *Context) ConsumeWASMGas(gas int64) error

func (*Context) Logger

func (c *Context) Logger() types.Logger

func (*Context) ReadMemory

func (c *Context) ReadMemory(ptr int32, size int32) ([]byte, error)

func (*Context) RemainingEVMGas

func (c *Context) RemainingEVMGas() (int64, error)

func (*Context) RemainingWASMGas

func (c *Context) RemainingWASMGas() (int64, error)

func (*Context) Reset

func (c *Context) Reset()

func (*Context) SetWASMGas

func (c *Context) SetWASMGas(gas int64) error

func (*Context) WriteMemory

func (c *Context) WriteMemory(ptr int32, data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL