]> Cypherpunks repositories - gostls13.git/commit
runtime: store consistent total allocation stats as uint64
authorMichael Anthony Knyszek <mknyszek@google.com>
Tue, 3 May 2022 19:28:25 +0000 (19:28 +0000)
committerGopher Robot <gobot@golang.org>
Tue, 3 May 2022 19:58:15 +0000 (19:58 +0000)
commit7c404d59db3591a7c5854b38dc0f05fcb7ac0cff
treec53ce941c2e4672bffa7116530cea819260dca7f
parentbccce9028996502e62a92255d79d5e003fbae63b
runtime: store consistent total allocation stats as uint64

Currently the consistent total allocation stats are managed as uintptrs,
which means they can easily overflow on 32-bit systems. Fix this by
storing these stats as uint64s. This will cause some minor performance
degradation on 32-bit systems, but there really isn't a way around this,
and it affects the correctness of the metrics we export.

Fixes #52680.

Change-Id: I7e6ca44047d46b4bd91c6f87c2d29f730e0d6191
Reviewed-on: https://go-review.googlesource.com/c/go/+/403758
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/mcache.go
src/runtime/metrics.go
src/runtime/mgcsweep.go
src/runtime/mstats.go