Pulled from the github.com/oxtoacart/bpool package (Apache licensed). SizedBufferPool implements a pool of bytes.Buffers in the form of a bounded channel. Buffers are pre-allocated to the requested size.
| 10 | // SizedBufferPool implements a pool of bytes.Buffers in the form of a bounded |
| 11 | // channel. Buffers are pre-allocated to the requested size. |
| 12 | type SizedBufferPool struct { |
| 13 | c chan *bytes.Buffer |
| 14 | a int |
| 15 | } |
| 16 | |
| 17 | // NewSizedBufferPool creates a new BufferPool bounded to the given size. |
| 18 | // size defines the number of buffers to be retained in the pool and alloc sets |
nothing calls this directly
no outgoing calls
no test coverage detected