1
0
mirror of https://github.com/golang/go synced 2024-11-19 15:24:46 -07:00

runtime: don't assume arena is in address order

On amd64, the arena is no longer in address space order, but currently
the heap dumper assumes that it is. Fix this assumption.

Change-Id: Iab1953cd36b359d0fb78ed49e5eb813116a18855
Reviewed-on: https://go-review.googlesource.com/96776
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Rick Hudson <rlh@golang.org>
This commit is contained in:
Austin Clements 2018-02-22 12:30:27 -05:00
parent b86e766813
commit 9680980efe

View File

@ -491,10 +491,13 @@ func dumpparams() {
var arenaStart, arenaEnd uintptr
for i, ha := range mheap_.arenas {
if ha != nil {
if arenaStart == 0 {
arenaStart = arenaBase(uint(i))
base := arenaBase(uint(i))
if arenaStart == 0 || base < arenaStart {
arenaStart = base
}
if base+heapArenaBytes > arenaEnd {
arenaEnd = base + heapArenaBytes
}
arenaEnd = arenaBase(uint(i)) + heapArenaBytes
}
}
dumpint(uint64(arenaStart))