free truncates the buffer and returns it to the pool.
()
| 36 | |
| 37 | // free truncates the buffer and returns it to the pool. |
| 38 | func (b *buffer) free() { |
| 39 | // Don't keep large buffers around. |
| 40 | if len(*b) > 16*1024 { |
| 41 | return |
| 42 | } |
| 43 | |
| 44 | *b = (*b)[:0] |
| 45 | bufPool.Put(b) |
| 46 | } |
| 47 | |
| 48 | // len returns the number of bytes written to the buffer. |
| 49 | func (b *buffer) len() int { |
no outgoing calls
no test coverage detected