Thread safety for status updates, periodically minify
This commit is contained in:
@@ -6,3 +6,17 @@ type Program struct {
|
||||
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user