vm: preallocate for istack

Avoid growing it in runtime.
This commit is contained in:
Roman Khimov 2021-11-30 23:07:27 +03:00
parent decff2bfb9
commit aa1da9de5a

View file

@ -107,6 +107,7 @@ func NewWithTrigger(t trigger.Type) *VM {
} }
initStack(&vm.istack, "invocation", nil) initStack(&vm.istack, "invocation", nil)
vm.istack.elems = make([]Element, 0, 8) // Most of invocations use one-two contracts, but they're likely to have internal calls.
vm.estack = newStack("evaluation", &vm.refs) vm.estack = newStack("evaluation", &vm.refs)
return vm return vm
} }