]> Cypherpunks repositories - gostls13.git/commit
runtime: use uintptr instead of int32 for counting to next heap profile sample
authorKeith Randall <khr@google.com>
Mon, 29 Jul 2019 19:51:19 +0000 (12:51 -0700)
committerKeith Randall <khr@golang.org>
Mon, 29 Jul 2019 21:07:49 +0000 (21:07 +0000)
commit01d137262a713b308c4308ed5b26636895e68d89
treee0a3502cbee9aabcc9060f2230e1f941b19eb294
parent7b8234b48fb66e9932abfbbaa24307480682e9b9
runtime: use uintptr instead of int32 for counting to next heap profile sample

Overflow of the comparison caused very large (>=1<<32) allocations to
sometimes not get sampled at all. Use uintptr so the comparison will
never overflow.

Fixes #33342

Tested on the example in 33342. I don't want to check a test in that
needs that much memory, however.

Change-Id: I51fe77a9117affed8094da93c0bc5f445ac2d3d3
Reviewed-on: https://go-review.googlesource.com/c/go/+/188017
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/malloc.go
src/runtime/mcache.go