Optimizes GoModuleFunction signature and ensures function result slices are unique (#860)

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Co-authored-by: Takeshi Yoneda <takeshi@tetrate.io>
This commit is contained in:
Crypt Keeper
2022-11-28 10:00:07 +08:00
committed by GitHub
parent 8990932a12
commit 0e851b71a8
23 changed files with 395 additions and 340 deletions

View File

@@ -20,11 +20,11 @@ func TestNewHostModuleBuilder_Compile(t *testing.T) {
return 0
}
gofunc1 := api.GoFunc(func(ctx context.Context, params []uint64) []uint64 {
return []uint64{0}
gofunc1 := api.GoFunc(func(ctx context.Context, stack []uint64) {
stack[0] = 0
})
gofunc2 := api.GoFunc(func(ctx context.Context, params []uint64) []uint64 {
return []uint64{0}
gofunc2 := api.GoFunc(func(ctx context.Context, stack []uint64) {
stack[0] = 0
})
tests := []struct {