mirror of
https://github.com/golang/go
synced 2024-11-11 22:20:22 -07:00
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 <bk@golangcn.org> Trust: Baokun Lee <bk@golangcn.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Emmanuel Odeke <emmanuel@orijtech.com>
This commit is contained in:
parent
359f44910f
commit
2de1f42857
@ -733,6 +733,7 @@ func (v *Buffers) consume(n int64) {
|
||||
return
|
||||
}
|
||||
n -= ln0
|
||||
(*v)[0] = nil
|
||||
*v = (*v)[1:]
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user