NewMemPoolAt returns a PoolAt, Get() returns an in memory buffer of max size N. Put() returns the buffer to the pool after resetting it. Get() and Put() errors will always be nil.
(N int64)
| 52 | // Put() returns the buffer to the pool after resetting it. |
| 53 | // Get() and Put() errors will always be nil. |
| 54 | func NewMemPoolAt(N int64) PoolAt { |
| 55 | return &memPoolAt{ |
| 56 | N: N, |
| 57 | PoolAt: NewPoolAt(func() BufferAt { |
| 58 | return New(N) |
| 59 | }), |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | func (m *memPoolAt) MarshalBinary() ([]byte, error) { |
| 64 | buf := bytes.NewBuffer(nil) |
searching dependent graphs…