Documentation ¶
Index ¶
- Constants
- type CallSite
- type DataBuffer
- type Env
- type FixedBuffer
- type InsnMap
- type Module
- func (m *Module) CallMap() []CallSite
- func (m *Module) Data() (data []byte, memoryOffset int)
- func (m *Module) FunctionMap() []int32
- func (m *Module) FunctionSignatures() (funcSigs []function.Type)
- func (m *Module) GlobalsSize() int
- func (m *Module) Load(r Reader, env Env, text TextBuffer, roData DataBuffer, roDataAddr int32, ...) (err error)
- func (m *Module) LoadCodeSection(r Reader, text TextBuffer, roData DataBuffer, roDataAddr int32, ...) (err error)
- func (m *Module) LoadDataSection(r Reader, data DataBuffer) (err error)
- func (m *Module) LoadPreliminarySections(r Reader, env Env) (err error)
- func (m *Module) MemoryLimits() (initial, maximum wasm.MemorySize)
- func (m *Module) ROData() (b []byte)
- func (m *Module) Signatures() []function.Type
- func (m *Module) Text() (b []byte)
- type Reader
- type TextBuffer
Constants ¶
const (
DefaultMemoryAlignment = 16 // see Module.MemoryAlignment
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataBuffer ¶ added in v0.3.0
type DataBuffer = module.DataBuffer
type FixedBuffer ¶ added in v0.3.0
type FixedBuffer struct {
// contains filtered or unexported fields
}
FixedBuffer is a fixed-capacity implementation of TextBuffer and DataBuffer.
func NewFixedBuffer ¶ added in v0.3.0
func NewFixedBuffer(b []byte) *FixedBuffer
func (*FixedBuffer) Bytes ¶ added in v0.3.0
func (f *FixedBuffer) Bytes() []byte
func (*FixedBuffer) Extend ¶ added in v0.3.0
func (f *FixedBuffer) Extend(n int) []byte
func (*FixedBuffer) Pos ¶ added in v0.3.0
func (f *FixedBuffer) Pos() int32
func (*FixedBuffer) PutByte ¶ added in v0.3.0
func (f *FixedBuffer) PutByte(b byte)
func (*FixedBuffer) PutBytes ¶ added in v0.3.0
func (f *FixedBuffer) PutBytes(b []byte)
func (*FixedBuffer) ResizeBytes ¶ added in v0.3.0
func (f *FixedBuffer) ResizeBytes(n int) []byte
type Module ¶
type Module struct { EntrySymbol string EntryArgs []uint64 MemoryAlignment int // see Data() UnknownSectionLoader func(r Reader, payloadLen uint32) error InsnMap InsnMap module.Module }
func (*Module) Data ¶
Data is available after data section has been loaded. memoryOffset is an offset into data. It will be a multiple of MemoryAlignment.
func (*Module) FunctionMap ¶
FunctionMap is available after code section has been loaded.
func (*Module) FunctionSignatures ¶
FunctionSignatures are available after preliminary sections have been loaded.
func (*Module) GlobalsSize ¶ added in v0.3.0
GlobalsSize is available after preliminary sections have been loaded.
func (*Module) Load ¶
func (m *Module) Load(r Reader, env Env, text TextBuffer, roData DataBuffer, roDataAddr int32, data DataBuffer) (err error)
Load all (remaining) sections.
func (*Module) LoadCodeSection ¶
func (m *Module) LoadCodeSection(r Reader, text TextBuffer, roData DataBuffer, roDataAddr int32, startTrigger chan<- struct{}) (err error)
LoadCodeSection, after loading the preliminary sections.
func (*Module) LoadDataSection ¶
func (m *Module) LoadDataSection(r Reader, data DataBuffer) (err error)
LoadDataSection, after loading the preliminary sections.
func (*Module) LoadPreliminarySections ¶
LoadPreliminarySections, excluding the code and data sections.
func (*Module) MemoryLimits ¶
func (m *Module) MemoryLimits() (initial, maximum wasm.MemorySize)
MemoryLimits are available after preliminary sections have been loaded.
func (*Module) Signatures ¶
Signatures are available after preliminary sections have been loaded.
type TextBuffer ¶ added in v0.3.0
type TextBuffer = module.TextBuffer