23 lines
456 B
Go
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
|
|
}
|