From: Michael Pratt Date: Mon, 27 Oct 2025 20:17:31 +0000 (-0400) Subject: internal/runtime/gc/scan: correct size class size check X-Git-Tag: go1.26rc1~452 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ff2ebf69c4f099adf90d6c6284f2b3fd2ff789f0;p=gostls13.git internal/runtime/gc/scan: correct size class size check This check intends to skip size classes that are too big for scanSpan, but it compares the size class index with a byte size. It must do the conversion first. For #73581. Change-Id: I6a6a636c8d19fa3bf2a2b609870d67d33f47f66e Reviewed-on: https://go-review.googlesource.com/c/go/+/715460 Auto-Submit: Michael Pratt LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek --- diff --git a/src/internal/runtime/gc/scan/scan_test.go b/src/internal/runtime/gc/scan/scan_test.go index 14a0f6f7f4..1208783b6f 100644 --- a/src/internal/runtime/gc/scan/scan_test.go +++ b/src/internal/runtime/gc/scan/scan_test.go @@ -114,7 +114,8 @@ func benchmarkScanSpanPackedAllSizeClasses(b *testing.B, nPages int) { if sc == 0 { continue } - if sc >= gc.MinSizeForMallocHeader { + size := gc.SizeClassToSize[sc] + if size >= gc.MinSizeForMallocHeader { break } b.Run(fmt.Sprintf("sizeclass=%d", sc), func(b *testing.B) {