(size int)
| 40 | } |
| 41 | |
| 42 | func getPoolIdx(size int) int { |
| 43 | if size < 2 { |
| 44 | return 0 |
| 45 | } |
| 46 | idx := bits.Len(uint(size-1)) - minPoolExpOf2 |
| 47 | if idx < 0 { |
| 48 | return 0 |
| 49 | } |
| 50 | return idx |
| 51 | } |
| 52 | |
| 53 | // Put returns buf to the pool. |
| 54 | func Put(buf *[]byte) { |