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

Method get

core/vm/intpool.go:86–96  ·  view source on GitHub ↗

get is looking for an available pool to return.

()

Source from the content-addressed store, hash-verified

84
85// get is looking for an available pool to return.
86func (ipp *intPoolPool) get() *intPool {
87 ipp.lock.Lock()
88 defer ipp.lock.Unlock()
89
90 if len(poolOfIntPools.pools) > 0 {
91 ip := ipp.pools[len(ipp.pools)-1]
92 ipp.pools = ipp.pools[:len(ipp.pools)-1]
93 return ip
94 }
95 return newIntPool()
96}
97
98// put a pool that has been allocated with get.
99func (ipp *intPoolPool) put(ip *intPool) {

Callers

nothing calls this directly

Calls 3

newIntPoolFunction · 0.85
LockMethod · 0.80
UnlockMethod · 0.80

Tested by

no test coverage detected