Documentation ¶
Overview ¶
Package wasm provides the generic components used to build wazero plugins.
Index ¶
- Constants
- func Read(memory api.Memory, offset, length uint32) []byte
- type Memory
- func (mem *Memory) Definition() api.MemoryDefinition
- func (mem *Memory) Grow(uint32) (uint32, bool)
- func (mem *Memory) Read(offset, length uint32) ([]byte, bool)
- func (mem *Memory) ReadByte(offset uint32) (byte, bool)
- func (mem *Memory) ReadFloat32Le(offset uint32) (float32, bool)
- func (mem *Memory) ReadFloat64Le(offset uint32) (float64, bool)
- func (mem *Memory) ReadUint16Le(offset uint32) (uint16, bool)
- func (mem *Memory) ReadUint32Le(offset uint32) (uint32, bool)
- func (mem *Memory) ReadUint64Le(offset uint32) (uint64, bool)
- func (mem *Memory) Size() uint32
- func (mem *Memory) Write(offset uint32, value []byte) bool
- func (mem *Memory) WriteByte(offset uint32, value byte) bool
- func (mem *Memory) WriteFloat32Le(offset uint32, value float32) bool
- func (mem *Memory) WriteFloat64Le(offset uint32, value float64) bool
- func (mem *Memory) WriteString(offset uint32, value string) bool
- func (mem *Memory) WriteUint16Le(offset uint32, value uint16) bool
- func (mem *Memory) WriteUint32Le(offset uint32, value uint32) bool
- func (mem *Memory) WriteUint64Le(offset uint32, value uint64) bool
- type SEGFAULT
Constants ¶
View Source
const PageSize = 64 * 1024
PageSize is the size of memory pages in WebAssembly programs (64 KiB).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Memory ¶
Memory is an implementation of the api.Memory interface of wazero backed by a Go byte slice. The memory has a fixed size and cannot grow nor shrink.
This type is mostly useful in tests to construct memory areas where output parameters can be stored.
func NewFixedSizeMemory ¶
NewFixedSizeMemory constructs a Memory instance of size bytes aligned on the WebAssembly page size.
func (*Memory) Definition ¶
func (mem *Memory) Definition() api.MemoryDefinition
func (*Memory) WriteFloat32Le ¶
func (*Memory) WriteFloat64Le ¶
Click to show internal directories.
Click to hide internal directories.