From 12c01f7698cd257b7d2e4795b0f8a971ec8533b6 Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Fri, 26 Jun 2020 16:38:40 -0700 Subject: [PATCH] runtime: ensure arenaBaseOffset makes it into DWARF (for viewcore) This constant does not make it into DWARF because it is an ideal constant larger than maxint (1<<63-1). DWARF has no way to represent signed values that large. Define a different typed constant that is unsigned and so can represent this constant properly. Viewcore needs this constant to interrogate the heap data structures. In addition, the sign of arenaBaseOffset changed in 1.15, and providing a new name lets viewcore detect the sign change easily. Change-Id: I4274a2f6e79ebbf1411e85d64758fac1672fb96b Reviewed-on: https://go-review.googlesource.com/c/go/+/240198 Run-TryBot: Keith Randall TryBot-Result: Gobot Gobot Reviewed-by: Michael Knyszek --- src/runtime/malloc.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index eaf8db7220..b3fac3de24 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -303,6 +303,8 @@ const ( // On other platforms, the user address space is contiguous // and starts at 0, so no offset is necessary. arenaBaseOffset = 0xffff800000000000*sys.GoarchAmd64 + 0x0a00000000000000*sys.GoosAix + // A typed version of this constant that will make it into DWARF (for viewcore). + arenaBaseOffsetUintptr = uintptr(arenaBaseOffset) // Max number of threads to run garbage collection. // 2, 3, and 4 are all plausible maximums depending -- 2.48.1