Skip to content

Commit

Permalink
reuse write buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
ppzqh committed Feb 4, 2025
1 parent 1a3e677 commit 0fbc42e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/remote/trans/gonet/bytebuffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func NewBufferReader(ir io.Reader) remote.ByteBuffer {
// NewBufferWriter creates a new remote.ByteBuffer using the given netpoll.ZeroCopyWriter.
func NewBufferWriter(iw io.Writer) remote.ByteBuffer {
rw := rwPool.Get().(*bufferReadWriter)
rw.writer = netpoll.NewWriter(iw)
rw.writer = netpoll.NewWriterReuseBuffer(iw)
rw.ioWriter = iw
rw.status = remote.BitWritable
return rw
Expand Down

0 comments on commit 0fbc42e

Please sign in to comment.