We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a816e75 commit e16a7efCopy full SHA for e16a7ef
core/vm/intpool.go
@@ -20,6 +20,8 @@ import "math/big"
20
21
var checkVal = big.NewInt(-42)
22
23
+const poolLimit = 256
24
+
25
// intPool is a pool of big integers that
26
// can be reused for all big.Int operations.
27
type intPool struct {
@@ -37,6 +39,10 @@ func (p *intPool) get() *big.Int {
37
39
return new(big.Int)
38
40
}
41
func (p *intPool) put(is ...*big.Int) {
42
+ if len(p.pool.data) > poolLimit {
43
+ return
44
+ }
45
46
for _, i := range is {
47
// verifyPool is a build flag. Pool verification makes sure the integrity
48
// of the integer pool by comparing values to a default value.
0 commit comments