标签:rpo otto margin get top ace bytes nbsp ret
package nsqd
import (
"bytes"
"sync"
)
var bp sync.Pool
func init() {
bp.New = func() interface{} {
return &bytes.Buffer{}
}
}
func bufferPoolGet() *bytes.Buffer {
return bp.Get().(*bytes.Buffer)
}
func bufferPoolPut(b *bytes.Buffer) {
bp.Put(b)
}
标签:rpo otto margin get top ace bytes nbsp ret
原文地址:http://www.cnblogs.com/zhangboyu/p/7457249.html