]> Cypherpunks repositories - gostls13.git/commit
runtime: size field for gQueue and gList
authorDmitrii Martynov <fkr011288@gmail.com>
Mon, 7 Apr 2025 14:08:19 +0000 (17:08 +0300)
committerGopher Robot <gobot@golang.org>
Tue, 15 Apr 2025 09:33:12 +0000 (02:33 -0700)
commite0dba45c620866bb16cd0db2c51732f03a9b27f3
treed8233f69739cb7b23794039b07faa7289b306223
parentba7b8ca336123017e43a2ab3310fd4a82122ef9d
runtime: size field for gQueue and gList

Before CL, all instances of gQueue and gList stored the size of
structures in a separate variable. The size changed manually and passed
as a separate argument to different functions. This CL added an
additional field to gQueue and gList structures to store the size. Also,
the calculation of size was moved into the implementation of API for
these structures. This allows to reduce possible errors by eliminating
manual calculation of the size and simplifying functions' signatures.

Change-Id: I087da2dfaec4925e4254ad40fce5ccb4c175ec41
Reviewed-on: https://go-review.googlesource.com/c/go/+/664777
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Keith Randall <khr@golang.org>
src/runtime/mgc.go
src/runtime/mgcmark.go
src/runtime/proc.go
src/runtime/runtime2.go