From 796786cd0cc1ed71da65fe9f1760b390b189c5cd Mon Sep 17 00:00:00 2001 From: Michael Anthony Knyszek Date: Tue, 12 May 2020 16:08:50 +0000 Subject: runtime: make maxOffAddr reflect the actual address space upper bound Currently maxOffAddr is defined in terms of the whole 64-bit address space, assuming that it's all supported, by using ^uintptr(0) as the maximal address in the offset space. In reality, the maximal address in the offset space is (1< Reviewed-by: Austin Clements Reviewed-by: Michael Pratt --- src/runtime/malloc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/runtime/malloc.go') diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index 0fbf45f897..77a5a38768 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -302,7 +302,7 @@ const ( // // On other platforms, the user address space is contiguous // and starts at 0, so no offset is necessary. - arenaBaseOffset = sys.GoarchAmd64*(1<<47) + (^0x0a00000000000000+1)&uintptrMask*sys.GoosAix + arenaBaseOffset = 0xffff800000000000*sys.GoarchAmd64 + 0x0a00000000000000*sys.GoosAix // Max number of threads to run garbage collection. // 2, 3, and 4 are all plausible maximums depending -- cgit v1.3-5-g9baa