Update according to bytebufferpool new API

This commit is contained in:
Aliaksandr Valialkin
2016-06-24 14:59:39 +03:00
parent 3148999d1e
commit 775eb9d43f
+2 -2
View File
@@ -44,7 +44,7 @@ func (b *ByteBuffer) Reset() {
// This reduces the number of memory allocations required for byte buffer
// management.
func AcquireByteBuffer() *ByteBuffer {
return (*ByteBuffer)(bytebufferpool.Acquire())
return (*ByteBuffer)(bytebufferpool.Get())
}
// ReleaseByteBuffer returns byte buffer to the pool.
@@ -52,7 +52,7 @@ func AcquireByteBuffer() *ByteBuffer {
// ByteBuffer.B mustn't be touched after returning it to the pool.
// Otherwise data races occur.
func ReleaseByteBuffer(b *ByteBuffer) {
bytebufferpool.Release(bb(b))
bytebufferpool.Put(bb(b))
}
func bb(b *ByteBuffer) *bytebufferpool.ByteBuffer {