From b48200dc4adb4c8383a0285babe06beedd5dfa20 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 24 Jun 2016 14:18:14 +0300 Subject: [PATCH] Return all the byte buffers to the pool until the first calibration --- pool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pool.go b/pool.go index e15e1ee..d15d377 100644 --- a/pool.go +++ b/pool.go @@ -50,7 +50,7 @@ func (p *byteBufferPool) Release(b *ByteBuffer) { } maxSize := int(atomic.LoadUint64(&p.maxSize)) - if maxSize > 0 && cap(b.B) <= maxSize { + if maxSize == 0 || cap(b.B) <= maxSize { b.B = b.B[:0] p.pool.Put(b) }