mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
reset on getting the buffer
This commit is contained in:
parent
8d42a1263b
commit
5a0986dca0
|
@ -226,7 +226,6 @@ func (m *LogBuffer) ReadFromBuffer(lastReadTime time.Time) (bufferCopy *bytes.Bu
|
|||
|
||||
}
|
||||
func (m *LogBuffer) ReleaseMeory(b *bytes.Buffer) {
|
||||
b.Reset()
|
||||
bufferPool.Put(b)
|
||||
}
|
||||
|
||||
|
@ -238,6 +237,7 @@ var bufferPool = sync.Pool{
|
|||
|
||||
func copiedBytes(buf []byte) (copied *bytes.Buffer) {
|
||||
copied = bufferPool.Get().(*bytes.Buffer)
|
||||
copied.Reset()
|
||||
copied.Write(buf)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue