Put returns buf to the pool.
(buf *[]byte)
| 52 | |
| 53 | // Put returns buf to the pool. |
| 54 | func Put(buf *[]byte) { |
| 55 | i := putPoolIdx(cap(*buf)) |
| 56 | if i < 0 { |
| 57 | return |
| 58 | } |
| 59 | |
| 60 | pools[i].Put(buf) |
| 61 | } |
| 62 | |
| 63 | func putPoolIdx(size int) int { |
| 64 | // Only exact power-of-2 sizes match pool buckets |