Avoids allocation of exports map per instance (#1275)

Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
Takeshi Yoneda
2023-03-23 00:37:56 -07:00
committed by GitHub
parent 7721f0ab97
commit cd1110c088
15 changed files with 128 additions and 81 deletions

View File

@@ -268,8 +268,8 @@ func TestModule_Global(t *testing.T) {
Init: wasm.ConstantExpression{Opcode: wasm.OpcodeI64Const, Data: leb128.EncodeInt64(globalVal)},
},
},
ExportSection: []wasm.Export{
{Type: wasm.ExternTypeGlobal, Name: "global"},
Exports: map[string]*wasm.Export{
"global": {Type: wasm.ExternTypeGlobal, Name: "global"},
},
},
expected: true,
@@ -283,8 +283,8 @@ func TestModule_Global(t *testing.T) {
Init: wasm.ConstantExpression{Opcode: wasm.OpcodeI64Const, Data: leb128.EncodeInt64(globalVal)},
},
},
ExportSection: []wasm.Export{
{Type: wasm.ExternTypeGlobal, Name: "global"},
Exports: map[string]*wasm.Export{
"global": {Type: wasm.ExternTypeGlobal, Name: "global"},
},
},
expected: true,