aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/mgcscavenge.go
diff options
context:
space:
mode:
authorSabyrzhan Tasbolatov <snovitoll@gmail.com>2024-04-14 16:55:57 +0500
committerGopher Robot <gobot@golang.org>2024-04-22 22:07:41 +0000
commit552faa8927a23fd5967435295c14af1741ac3653 (patch)
tree29a005cdc9789cb3bf31a5997511dafab36435b9 /src/runtime/mgcscavenge.go
parent674657e1304b0ea1815257623150a2e06d8ddac2 (diff)
downloadgo-552faa8927a23fd5967435295c14af1741ac3653.tar.gz
go-552faa8927a23fd5967435295c14af1741ac3653.zip
runtime: reduced struct sizes found via pahole
During my research of pahole with Go structs, I've found couple of structs in runtime/ pkg where we can reduce several structs' sizes highligted by pahole tool which detect byte holes and paddings. Overall, there are 80 bytes reduced. Change-Id: I398e5ed6f5b199394307741981cb5ad5b875e98f Reviewed-on: https://go-review.googlesource.com/c/go/+/578795 Auto-Submit: Keith Randall <khr@golang.org> Reviewed-by: Joedian Reid <joedian@google.com> Reviewed-by: Keith Randall <khr@google.com> Reviewed-by: Keith Randall <khr@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime/mgcscavenge.go')
-rw-r--r--src/runtime/mgcscavenge.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/runtime/mgcscavenge.go b/src/runtime/mgcscavenge.go
index dede4a1ad3..8102940a7c 100644
--- a/src/runtime/mgcscavenge.go
+++ b/src/runtime/mgcscavenge.go
@@ -281,15 +281,19 @@ type scavengerState struct {
// g is the goroutine the scavenger is bound to.
g *g
- // parked is whether or not the scavenger is parked.
- parked bool
-
// timer is the timer used for the scavenger to sleep.
timer *timer
// sysmonWake signals to sysmon that it should wake the scavenger.
sysmonWake atomic.Uint32
+ // parked is whether or not the scavenger is parked.
+ parked bool
+
+ // printControllerReset instructs printScavTrace to signal that
+ // the controller was reset.
+ printControllerReset bool
+
// targetCPUFraction is the target CPU overhead for the scavenger.
targetCPUFraction float64
@@ -312,10 +316,6 @@ type scavengerState struct {
// value. Used if the controller's assumptions fail to hold.
controllerCooldown int64
- // printControllerReset instructs printScavTrace to signal that
- // the controller was reset.
- printControllerReset bool
-
// sleepStub is a stub used for testing to avoid actually having
// the scavenger sleep.
//