NewPartition returns a Buffer which uses a Pool to extend or shrink its size as needed. It automatically allocates new buffers with pool.Get() to extend is length, and pool.Put() to release unused buffers as it shrinks.
(pool Pool, buffers ...Buffer)
| 15 | // It automatically allocates new buffers with pool.Get() to extend is length, and |
| 16 | // pool.Put() to release unused buffers as it shrinks. |
| 17 | func NewPartition(pool Pool, buffers ...Buffer) Buffer { |
| 18 | return &partition{ |
| 19 | Pool: pool, |
| 20 | List: buffers, |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | func (buf *partition) Cap() int64 { |
| 25 | return math.MaxInt64 |
no outgoing calls
searching dependent graphs…