Documentation ¶
Overview ¶
Package binding contains import and export utilities.
Index ¶
Constants ¶
View Source
const ( VectorIndexLastImportFunc = -3 VectorIndexTrapHandler = -2 VectorIndexGrowMemoryLimit = -1 )
Well-known indexes of the import vector. Import function addresses precede the trap handler address and the memory growth limit.
Variables ¶
This section is empty.
Functions ¶
func BindImports ¶
func BindImports(mod *compile.Module, reso ImportResolver) (err error)
Types ¶
type ImportResolver ¶
type ImportResolver interface { ResolveFunc(module, field string, sig wa.FuncType) (vectorIndex int, err error) ResolveGlobal(module, field string, t wa.Type) (init uint64, err error) }
ImportResolver maps symbols to vector indexes and constant values.
ResolveFunc returns a negative index; the vector is addressed from the end. VectorIndexLastImportFunc is the largest valid index which ResolveFunc can return.
ResolveGlobal returns a bit pattern the interpretation of which depends on the scalar type.
Click to show internal directories.
Click to hide internal directories.