Files
subcoding/vm/program.go

23 lines
456 B
Go
Raw Normal View History

2021-11-19 20:16:01 -10:00
package vm
type Program struct {
2021-11-20 18:27:06 -10:00
GlobalMemorySize uint64
FunctionMemorySize uint64
2021-11-20 19:25:16 -10:00
InstructionLimit uint64
2021-11-20 18:27:06 -10:00
Functions []*Function
2021-11-19 20:16:01 -10:00
}
func (prog *Program) Copy() *Program {
ret := &Program{
GlobalMemorySize: prog.GlobalMemorySize,
FunctionMemorySize: prog.FunctionMemorySize,
InstructionLimit: prog.InstructionLimit,
}
for _, fnc := range prog.Functions {
ret.Functions = append(ret.Functions, fnc.Copy())
}
return ret
}