getN gets the last n buffers in bp.cache will panic if you ask for too many buffers Call with mu held
(n int)
| 110 | // |
| 111 | // Call with mu held |
| 112 | func (bp *Pool) getN(n int) [][]byte { |
| 113 | i := len(bp.cache) - n |
| 114 | bufs := slices.Clone(bp.cache[i:]) |
| 115 | bp.cache = slices.Delete(bp.cache, i, len(bp.cache)) |
| 116 | return bufs |
| 117 | } |
| 118 | |
| 119 | // put puts the buffer on the end of bp.cache |
| 120 | // |