get is looking for an available pool to return.
()
| 84 | |
| 85 | // get is looking for an available pool to return. |
| 86 | func (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. |
| 99 | func (ipp *intPoolPool) put(ip *intPool) { |
nothing calls this directly
no test coverage detected