Thread safety for status updates, periodically minify
This commit is contained in:
@@ -3,3 +3,13 @@ package vm
|
||||
type Function struct {
|
||||
Instructions []*Instruction
|
||||
}
|
||||
|
||||
func (fnc *Function) Copy() *Function {
|
||||
ret := &Function{}
|
||||
|
||||
for _, instr := range fnc.Instructions {
|
||||
ret.Instructions = append(ret.Instructions, instr.Copy())
|
||||
}
|
||||
|
||||
return ret
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user