Return all the byte buffers to the pool until the first calibration

This commit is contained in:
Aliaksandr Valialkin
2016-06-24 14:18:14 +03:00
parent ea471ff2ce
commit b48200dc4a
+1 -1
View File
@@ -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)
}