core/vm: use a callcontext struct (#20761)
* core/vm: use a callcontext struct * core/vm: fix tests * core/vm/runtime: benchmark * core/vm: make intpool push inlineable, unexpose callcontext
This commit is contained in:
committed by
GitHub
parent
0bec6a43f6
commit
8dc8941551
@ -53,6 +53,17 @@ func (p *intPool) getZero() *big.Int {
|
||||
return new(big.Int)
|
||||
}
|
||||
|
||||
// putOne returns an allocated big int to the pool to be later reused by get calls.
|
||||
// Note, the values as saved as is; neither put nor get zeroes the ints out!
|
||||
// As opposed to 'put' with variadic args, this method becomes inlined by the
|
||||
// go compiler
|
||||
func (p *intPool) putOne(i *big.Int) {
|
||||
if len(p.pool.data) > poolLimit {
|
||||
return
|
||||
}
|
||||
p.pool.push(i)
|
||||
}
|
||||
|
||||
// put returns an allocated big int to the pool to be later reused by get calls.
|
||||
// Note, the values as saved as is; neither put nor get zeroes the ints out!
|
||||
func (p *intPool) put(is ...*big.Int) {
|
||||
|
Reference in New Issue
Block a user