github.com/tetratelabs/wazero@v1.7.3-0.20240513003603-48f702e154b5/internal/testing/binaryencoding/table.go (about)

     1  package binaryencoding
     2  
     3  import (
     4  	"github.com/tetratelabs/wazero/internal/wasm"
     5  )
     6  
     7  // EncodeTable returns the wasm.Table encoded in WebAssembly 1.0 (20191205) Binary Format.
     8  //
     9  // See https://www.w3.org/TR/2019/REC-wasm-core-1-20191205/#binary-table
    10  func EncodeTable(i *wasm.Table) []byte {
    11  	return append([]byte{i.Type}, EncodeLimitsType(i.Min, i.Max, false)...)
    12  }