Skip to content

Commit adbf595

Browse files
committed
internal/runtime/gc/scan: avoid -1 index when cache sizes unavailable
Fixes golang#74984. Fixes golang#74983. Change-Id: I011c66c2005bc4d92f1d17f1f8ce88158634f71f Reviewed-on: https://go-review.googlesource.com/c/go/+/695476 Auto-Submit: Michael Knyszek <[email protected]> Reviewed-by: Michael Pratt <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent 4e182db commit adbf595

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/internal/runtime/gc/scan/scan_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ func benchmarkCacheSizes(b *testing.B, fn func(b *testing.B, heapPages int)) {
100100
fn(b, pages)
101101
})
102102
}
103+
if len(cacheSizes) == 0 {
104+
return
105+
}
103106
ramPages := int(cacheSizes[len(cacheSizes)-1]*3/2) / gc.PageSize
104107
b.Run(fmt.Sprintf("cache=ram/pages=%d", ramPages), func(b *testing.B) {
105108
fn(b, ramPages)

0 commit comments

Comments
 (0)