Free truncates the buffer and returns it to the pool.
()
| 20 | |
| 21 | // Free truncates the buffer and returns it to the pool. |
| 22 | func (b *buffer) Free() { |
| 23 | // Don't keep large buffers around. |
| 24 | if len(*b) > 16*1024 { |
| 25 | return |
| 26 | } |
| 27 | |
| 28 | b.Reset() |
| 29 | bufPool.Put(b) |
| 30 | } |
| 31 | |
| 32 | // Reset truncates the buffer. |
| 33 | func (b *buffer) Reset() { |