1
0
mirror of https://github.com/golang/go synced 2024-11-26 08:27:56 -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:
Baokun Lee 2021-03-23 11:18:50 +08:00 committed by Emmanuel Odeke
parent 359f44910f
commit 2de1f42857

View File

@ -733,6 +733,7 @@ func (v *Buffers) consume(n int64) {
return return
} }
n -= ln0 n -= ln0
(*v)[0] = nil
*v = (*v)[1:] *v = (*v)[1:]
} }
} }