Documentation ¶
Index ¶
- type Instance
- func (inst Instance) AddrAppToNative(appOffset uint32) *uint8
- func (inst Instance) AddrNativeToApp(nativePtr *uint8) uint32
- func (inst *Instance) CallFunc(funcName string, argc uint32, args []uint32) error
- func (inst *Instance) CallFuncV(funcName string, numResults uint32, results []interface{}, args ...interface{}) error
- func (inst *Instance) Destroy()
- func (inst Instance) DumpCallStack()
- func (inst Instance) DumpMemoryConsumption()
- func (inst Instance) GetAppAddrRange(appOffset uint32) (bool, uint32, uint32)
- func (inst *Instance) GetException() string
- func (inst Instance) GetNativeAddrRange(nativePtr *uint8) (bool, *uint8, *uint8)
- func (inst Instance) ModuleFree(offset uint32)
- func (inst Instance) ModuleMalloc(size uint32) (uint32, *uint8)
- func (inst Instance) ValidateAppAddr(appOffset uint32, size uint32) bool
- func (inst Instance) ValidateNativeAddr(nativePtr *uint8, size uint32) bool
- func (inst Instance) ValidateStrAddr(appStrOffset uint32) bool
- type LogLevel
- type Module
- func (module *Module) Destroy()
- func (module *Module) SetWasiAddrPool(addrPool [][]byte)
- func (module *Module) SetWasiArgs(dirList [][]byte, mapDirList [][]byte, env [][]byte, argv [][]byte)
- func (module *Module) SetWasiArgsEx(dirList [][]byte, mapDirList [][]byte, env [][]byte, argv [][]byte, ...)
- func (module *Module) SetWasiNsLookupPool(nsLookupPool [][]byte)
- type RuntimeSingleton
- func (runtime *RuntimeSingleton) Destroy()
- func (runtime *RuntimeSingleton) DestroyThreadEnv()
- func (runtime *RuntimeSingleton) Free(ptr *uint8)
- func (runtime *RuntimeSingleton) FullInit(allocWithPool bool, heapBuf []byte, maxThreadNum uint) error
- func (runtime *RuntimeSingleton) Init() error
- func (runtime *RuntimeSingleton) InitThreadEnv() bool
- func (runtime *RuntimeSingleton) Malloc(size uint32) *uint8
- func (runtime *RuntimeSingleton) SetLogLevel(level LogLevel)
- func (runtime *RuntimeSingleton) ThreadEnvInited() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance the instance struct
func NewInstance ¶
NewInstance Create instance from the module
func (Instance) AddrAppToNative ¶
AddrAppToNative AddrAppToNative
func (Instance) AddrNativeToApp ¶
AddrNativeToApp AddrNativeToApp
func (*Instance) CallFunc ¶
CallFunc Call the wasm function with argument in the uint32 array, and store the return values back into the array
func (*Instance) CallFuncV ¶
func (inst *Instance) CallFuncV(funcName string, numResults uint32, results []interface{}, args ...interface{}) error
CallFuncV Call the wasm function with variant arguments, and store the return values back into the results array
func (Instance) DumpMemoryConsumption ¶
func (inst Instance) DumpMemoryConsumption()
DumpMemoryConsumption DumpMemoryConsumption
func (Instance) GetAppAddrRange ¶
GetAppAddrRange GetAppAddrRange
func (*Instance) GetException ¶
GetException Get exception info of the instance
func (Instance) GetNativeAddrRange ¶
GetNativeAddrRange GetNativeAddrRange
func (Instance) ModuleFree ¶
ModuleFree Free memory to the heap of the instance */
func (Instance) ModuleMalloc ¶
ModuleMalloc Allocate memory from the heap of the instance
func (Instance) ValidateAppAddr ¶
ValidateAppAddr ValidateAppAddr
func (Instance) ValidateNativeAddr ¶
ValidateNativeAddr ValidateNativeAddr
func (Instance) ValidateStrAddr ¶
ValidateStrAddr ValidateStrAddr
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module struct
func (*Module) SetWasiAddrPool ¶
SetWasiAddrPool Set module's wasi network address pool
func (*Module) SetWasiArgs ¶
func (module *Module) SetWasiArgs(dirList [][]byte, mapDirList [][]byte, env [][]byte, argv [][]byte)
SetWasiArgs Set module's wasi arguments
func (*Module) SetWasiArgsEx ¶
func (module *Module) SetWasiArgsEx(dirList [][]byte, mapDirList [][]byte, env [][]byte, argv [][]byte, stdinfd int, stdoutfd int, stderrfd int)
SetWasiArgsEx Set module's wasi arguments
func (*Module) SetWasiNsLookupPool ¶
SetWasiNsLookupPool Set module's wasi domain lookup pool
type RuntimeSingleton ¶
type RuntimeSingleton struct {
// contains filtered or unexported fields
}
RuntimeSingleton struct
func (*RuntimeSingleton) Destroy ¶
func (runtime *RuntimeSingleton) Destroy()
Destroy the WASM runtime environment
func (*RuntimeSingleton) DestroyThreadEnv ¶
func (runtime *RuntimeSingleton) DestroyThreadEnv()
DestroyThreadEnv DestroyThreadEnv
func (*RuntimeSingleton) Free ¶
func (runtime *RuntimeSingleton) Free(ptr *uint8)
Free Free memory to runtime memory environment
func (*RuntimeSingleton) FullInit ¶
func (runtime *RuntimeSingleton) FullInit(allocWithPool bool, heapBuf []byte, maxThreadNum uint) error
FullInit Initialize the WASM runtime environment
func (*RuntimeSingleton) Init ¶
func (runtime *RuntimeSingleton) Init() error
Init Initialize the WASM runtime environment
func (*RuntimeSingleton) InitThreadEnv ¶
func (runtime *RuntimeSingleton) InitThreadEnv() bool
InitThreadEnv InitThreadEnv
func (*RuntimeSingleton) Malloc ¶
func (runtime *RuntimeSingleton) Malloc(size uint32) *uint8
Malloc Allocate memory from runtime memory environment
func (*RuntimeSingleton) SetLogLevel ¶
func (runtime *RuntimeSingleton) SetLogLevel(level LogLevel)
SetLogLevel Set log verbose level (0 to 5, default is 2), larger level with more log
func (*RuntimeSingleton) ThreadEnvInited ¶
func (runtime *RuntimeSingleton) ThreadEnvInited() bool
ThreadEnvInited ThreadEnvInited