wamr

package
v0.0.0-...-9773390 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Runtime

func Runtime() *_Runtime

Return the runtime singleton

Types

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

func NewInstance

func NewInstance(module *Module,
	stackSize uint, heapSize uint) (*Instance, error)

Create instance from the module

func (Instance) AddrAppToNative

func (self Instance) AddrAppToNative(app_offset uint64) *uint8

func (Instance) AddrNativeToApp

func (self Instance) AddrNativeToApp(native_ptr *uint8) uint64

func (*Instance) CallFunc

func (self *Instance) CallFunc(funcName string,
	argc uint32, args []uint32) error

Call the wasm function with argument in the uint32 array, and store

the return values back into the array

func (*Instance) CallFuncV

func (self *Instance) CallFuncV(funcName string,
	num_results uint32, results []interface{},
	args ...interface{}) error

Call the wasm function with variant arguments, and store the return

values back into the results array

func (*Instance) Destroy

func (self *Instance) Destroy()

Destroy the instance

func (Instance) DumpCallStack

func (self Instance) DumpCallStack()

func (Instance) DumpMemoryConsumption

func (self Instance) DumpMemoryConsumption()

func (Instance) GetAppAddrRange

func (self Instance) GetAppAddrRange(app_offset uint64) (bool,
	uint64,
	uint64)

func (*Instance) GetException

func (self *Instance) GetException() string

Get exception info of the instance

func (Instance) GetNativeAddrRange

func (self Instance) GetNativeAddrRange(native_ptr *uint8) (bool,
	*uint8,
	*uint8)

func (Instance) ModuleFree

func (self Instance) ModuleFree(offset uint64)

Free memory to the heap of the instance

func (Instance) ModuleMalloc

func (self Instance) ModuleMalloc(size uint64) (uint64, *uint8)

Allocate memory from the heap of the instance

func (Instance) ValidateAppAddr

func (self Instance) ValidateAppAddr(app_offset uint64, size uint64) bool

func (Instance) ValidateNativeAddr

func (self Instance) ValidateNativeAddr(native_ptr *uint8, size uint64) bool

func (Instance) ValidateStrAddr

func (self Instance) ValidateStrAddr(app_str_offset uint64) bool

type LogLevel

type LogLevel uint32
const (
	LOG_LEVEL_FATAL   LogLevel = 0
	LOG_LEVEL_ERROR   LogLevel = 1
	LOG_LEVEL_WARNING LogLevel = 2
	LOG_LEVEL_DEBUG   LogLevel = 3
	LOG_LEVEL_VERBOSE LogLevel = 4
)

type Module

type Module struct {
	// contains filtered or unexported fields
}

func NewModule

func NewModule(wasmBytes []byte) (*Module, error)

Create WASM/AOT module from the memory buffer

func (*Module) Destroy

func (self *Module) Destroy()

Destroy the module

func (*Module) SetWasiAddrPool

func (self *Module) SetWasiAddrPool(addrPool [][]byte)

Set module's wasi network address pool

func (*Module) SetWasiArgs

func (self *Module) SetWasiArgs(dirList [][]byte, mapDirList [][]byte,
	env [][]byte, argv [][]byte)

Set module's wasi arguments

func (*Module) SetWasiArgsEx

func (self *Module) SetWasiArgsEx(dirList [][]byte, mapDirList [][]byte,
	env [][]byte, argv [][]byte,
	stdinfd int, stdoutfd int, stderrfd int)

Set module's wasi arguments

func (*Module) SetWasiNsLookupPool

func (self *Module) SetWasiNsLookupPool(nsLookupPool [][]byte)

Set module's wasi domain lookup pool

Directories

Path Synopsis
packaged
lib

Jump to

Keyboard shortcuts

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