fasthttputil: pre-allocate memory in newly created byteBuffer

This commit is contained in:
Aliaksandr Valialkin
2016-02-04 19:48:52 +02:00
parent 26f2cab187
commit 08aecdd0f4
+3 -1
View File
@@ -246,7 +246,9 @@ func releaseByteBuffer(b *byteBuffer) {
var byteBufferPool = &sync.Pool{
New: func() interface{} {
return &byteBuffer{}
return &byteBuffer{
b: make([]byte, 1024),
}
},
}