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!
(is ...*big.Int)
| 56 | // put returns an allocated big int to the pool to be later reused by get calls. |
| 57 | // Note, the values as saved as is; neither put nor get zeroes the ints out! |
| 58 | func (p *intPool) put(is ...*big.Int) { |
| 59 | if len(p.pool.data) > poolLimit { |
| 60 | return |
| 61 | } |
| 62 | for _, i := range is { |
| 63 | // verifyPool is a build flag. Pool verification makes sure the integrity |
| 64 | // of the integer pool by comparing values to a default value. |
| 65 | if verifyPool { |
| 66 | i.Set(checkVal) |
| 67 | } |
| 68 | p.pool.push(i) |
| 69 | } |
| 70 | } |
| 71 | |
| 72 | // The intPool pool's default capacity |
| 73 | const poolDefaultCap = 25 |