Open zhuzhu67373 opened 1 year ago
Bytes() and String() cannot be used when using fflib.Buffer in sync.Pool , like:
Bytes()
String()
fflib.Buffer
sync.Pool
var bufPool = sync.Pool{ New: func() interface{} { return fflib.NewBuffer([]byte{}) }, } func GetBuf() *fflib.Buffer { return bufPool.Get().(*fflib.Buffer) } func PutBuf(buf *fflib.Buffer) { buf.Reset() bufPool.Put(buf) }
So I add copy version of Bytes() and String()
Bytes()
andString()
cannot be used when usingfflib.Buffer
insync.Pool
, like:So I add copy version of
Bytes()
andString()