(length int)
| 160 | } |
| 161 | |
| 162 | func (p swappableBufferPool) Get(length int) *[]byte { |
| 163 | var pool mem.BufferPool |
| 164 | if useNopBufferPool.Load() { |
| 165 | pool = mem.NopBufferPool{} |
| 166 | } else { |
| 167 | pool = p.BufferPool |
| 168 | } |
| 169 | return pool.Get(length) |
| 170 | } |
| 171 | |
| 172 | func (p swappableBufferPool) Put(i *[]byte) { |
| 173 | if useNopBufferPool.Load() { |