]> Cypherpunks repositories - gostls13.git/commit
runtime: only clear inline mark bits on span alloc if necessary
authorMichael Anthony Knyszek <mknyszek@google.com>
Mon, 14 Jul 2025 19:28:57 +0000 (19:28 +0000)
committerGopher Robot <gobot@golang.org>
Tue, 15 Jul 2025 19:24:32 +0000 (12:24 -0700)
commit6d4a91c7a5b5723aa1fc1461eb3e9602ccf9606a
tree074593536bf99abf45e268f7480c33883ac93233
parent0c6296ab128eae1980eb81a51b982766a5d7b5fb
runtime: only clear inline mark bits on span alloc if necessary

This change modifies initInlineMarkBits to only clear mark bits if the
span wasn't just freshly allocated from the OS, where we know the bits
are already zeroed. This probably doesn't make a huge difference most of
the time, but it's an easy optimization and helps rule it out as a
source of slowdown.

For #73581.

Change-Id: I78cd4d8968bb0bf6536c0a38ef9397475c39f0ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/687937
Auto-Submit: Michael Knyszek <mknyszek@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
src/runtime/mgcmark_greenteagc.go