mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
internal/runtime/gc/scan: avoid -1 index when cache sizes unavailable
Fixes #74984. Fixes #74983. Change-Id: I011c66c2005bc4d92f1d17f1f8ce88158634f71f Reviewed-on: https://go-review.googlesource.com/c/go/+/695476 Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Michael Pratt <mpratt@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
4e182db5fc
commit
adbf59525c
1 changed files with 3 additions and 0 deletions
|
|
@ -100,6 +100,9 @@ func benchmarkCacheSizes(b *testing.B, fn func(b *testing.B, heapPages int)) {
|
|||
fn(b, pages)
|
||||
})
|
||||
}
|
||||
if len(cacheSizes) == 0 {
|
||||
return
|
||||
}
|
||||
ramPages := int(cacheSizes[len(cacheSizes)-1]*3/2) / gc.PageSize
|
||||
b.Run(fmt.Sprintf("cache=ram/pages=%d", ramPages), func(b *testing.B) {
|
||||
fn(b, ramPages)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue