aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/runtime/export_test.go')
-rw-r--r--src/runtime/export_test.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/runtime/export_test.go b/src/runtime/export_test.go
index 22fef3134f..59f72ae709 100644
--- a/src/runtime/export_test.go
+++ b/src/runtime/export_test.go
@@ -1051,7 +1051,19 @@ func FreePageAlloc(pp *PageAlloc) {
//
// This should not be higher than 0x100*pallocChunkBytes to support
// mips and mipsle, which only have 31-bit address spaces.
-var BaseChunkIdx = ChunkIdx(chunkIndex(((0xc000*pageAlloc64Bit + 0x100*pageAlloc32Bit) * pallocChunkBytes) + arenaBaseOffset*sys.GoosAix))
+var BaseChunkIdx = func() ChunkIdx {
+ var prefix uintptr
+ if pageAlloc64Bit != 0 {
+ prefix = 0xc000
+ } else {
+ prefix = 0x100
+ }
+ baseAddr := prefix * pallocChunkBytes
+ if sys.GoosAix != 0 {
+ baseAddr += arenaBaseOffset
+ }
+ return ChunkIdx(chunkIndex(baseAddr))
+}()
// PageBase returns an address given a chunk index and a page index
// relative to that chunk.