mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-14 15:56:44 +03:00
Update according to bytebufferpool new API
This commit is contained in:
+2
-2
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user