MCPcopy Create free account
hub / github.com/CPChain/chain / put

Method put

core/vm/intpool.go:58–70  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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!
58func (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
73const poolDefaultCap = 25

Callers 15

opAddFunction · 0.45
opSubFunction · 0.45
opMulFunction · 0.45
opDivFunction · 0.45
opSdivFunction · 0.45
opModFunction · 0.45
opSmodFunction · 0.45
opExpFunction · 0.45
opSignExtendFunction · 0.45
opLtFunction · 0.45
opGtFunction · 0.45
opSltFunction · 0.45

Calls 2

SetMethod · 0.45
pushMethod · 0.45

Tested by 5

TestIntPoolPoolPutFunction · 0.36
TestIntPoolPoolReUseFunction · 0.36
testTwoOperandOpFunction · 0.36
TestByteOpFunction · 0.36
TestOpMstoreFunction · 0.36