wwrap

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package wwrap wraps wazero modules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Module

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

Module wraps a module with various optimizations and enhancements.

func New

func New(mod api.Module) *Module

func (*Module) Alloc

func (m *Module) Alloc(n int) (addr uint32, err error)

Alloc allocates memory. If n is zero, nil is returned successfully.

func (*Module) Call

func (m *Module) Call(name string, params ...uint64) ([]uint64, error)

Call calls an exported function.

func (*Module) CallContext

func (m *Module) CallContext(ctx context.Context, name string, params ...uint64) ([]uint64, error)

CallContext calls an exported function, caching it based on the address of the string literal, and returning a slice of return values valid until the next call.

It panics if the call signature is incorrect. If it returns an error, it will be one from [Catch].

func (*Module) Free

func (m *Module) Free(addr uint32)

Free frees memory. If addr is zero, no action is taken.

func (*Module) Module

func (m *Module) Module() api.Module

Jump to

Keyboard shortcuts

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