Files
subcoding/vm/program.go
2021-11-22 22:19:38 -08:00

23 lines
456 B
Go

package vm
type Program struct {
GlobalMemorySize uint64
FunctionMemorySize uint64
InstructionLimit uint64
Functions []*Function
}
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
}