mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-06 19:55:10 +00:00
vm: remove istack redirection in VM
VM always has istack and it doesn't even change, so doing this microallocation makes no sense. Notice that estack is a bit harder to change we do replace it in some cases and we compare pointers to it as well.
This commit is contained in:
parent
ff7d594bef
commit
bdb2d24a5a
2 changed files with 12 additions and 10 deletions
|
@ -162,13 +162,15 @@ func NewStack(n string) *Stack {
|
|||
}
|
||||
|
||||
func newStack(n string, refc *refCounter) *Stack {
|
||||
s := &Stack{
|
||||
name: n,
|
||||
refs: refc,
|
||||
}
|
||||
s := new(Stack)
|
||||
initStack(s, n, refc)
|
||||
return s
|
||||
}
|
||||
func initStack(s *Stack, n string, refc *refCounter) {
|
||||
s.name = n
|
||||
s.refs = refc
|
||||
s.top.next = &s.top
|
||||
s.top.prev = &s.top
|
||||
return s
|
||||
}
|
||||
|
||||
// Clear clears all elements on the stack and set its length to 0.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue