Supports functions with multiple results (multi-value) (#446)
Signed-off-by: Adrian Cole <adrian@tetrate.io> Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
10
api/wasm.go
10
api/wasm.go
@@ -248,6 +248,16 @@ type Memory interface {
|
||||
Write(offset uint32, v []byte) bool
|
||||
}
|
||||
|
||||
// EncodeI32 encodes the input as a ValueTypeI32.
|
||||
func EncodeI32(input int32) uint64 {
|
||||
return uint64(uint32(input))
|
||||
}
|
||||
|
||||
// EncodeI64 encodes the input as a ValueTypeI64.
|
||||
func EncodeI64(input int64) uint64 {
|
||||
return uint64(input)
|
||||
}
|
||||
|
||||
// EncodeF32 encodes the input as a ValueTypeF32.
|
||||
// See DecodeF32
|
||||
func EncodeF32(input float32) uint64 {
|
||||
|
||||
Reference in New Issue
Block a user