Skip to content

Commit 2de1f42

Browse files
oioojodeke-em
authored andcommitted
net: clear completed Buffers to permit earlier collection
Fixes #45163 Change-Id: Ie034145e3818930bb19371d73ec6960cbdc55aa7 Reviewed-on: https://go-review.googlesource.com/c/go/+/303829 Run-TryBot: Baokun Lee <[email protected]> Trust: Baokun Lee <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Emmanuel Odeke <[email protected]>
1 parent 359f449 commit 2de1f42

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/net/net.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ func (v *Buffers) consume(n int64) {
733733
return
734734
}
735735
n -= ln0
736+
(*v)[0] = nil
736737
*v = (*v)[1:]
737738
}
738739
}

0 commit comments

Comments
 (0)