aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2018-02-28 01:39:03 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2018-02-28 01:39:03 +0000
commitfa3aa4e118f91b3a1b1357a974386c5530db8bc6 (patch)
tree1c07855b97c253e5be40eeb767b23262df57483a /libgo
parent5778c500e40007aa35de228303cfe53f957a6338 (diff)
runtime: update AIX memory allocation for new versions
Reviewed-on: https://go-review.googlesource.com/97357 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258052 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo')
-rw-r--r--libgo/go/runtime/malloc.go13
1 files changed, 8 insertions, 5 deletions
diff --git a/libgo/go/runtime/malloc.go b/libgo/go/runtime/malloc.go
index c27aa487df3..1405a54639c 100644
--- a/libgo/go/runtime/malloc.go
+++ b/libgo/go/runtime/malloc.go
@@ -296,8 +296,8 @@ func mallocinit() {
// allocation at 0x40 << 32 because when using 4k pages with 3-level
// translation buffers, the user address space is limited to 39 bits
// On darwin/arm64, the address space is even smaller.
- // On AIX, mmap adresses range start at 0x07000000_00000000 for 64 bits
- // processes.
+ // On AIX, mmap adresses range starts at 0x0700000000000000 for 64-bit
+ // processes. The new address space allocator starts at 0x0A00000000000000.
arenaSize := round(_MaxMem, _PageSize)
pSize = bitmapSize + spansSize + arenaSize + _PageSize
for i := 0; i <= 0x7f; i++ {
@@ -307,13 +307,16 @@ func mallocinit() {
case GOARCH == "arm64":
p = uintptr(i)<<40 | uintptrMask&(0x0040<<32)
case GOOS == "aix":
- i = 1
- p = uintptr(i)<<32 | uintptrMask&(0x70<<52)
+ if i == 0 {
+ p = uintptrMask&(1<<32) | uintptrMask&(0xa0<<52)
+ } else {
+ p = uintptr(i)<<32 | uintptrMask&(0x70<<52)
+ }
default:
p = uintptr(i)<<40 | uintptrMask&(0x00c0<<32)
}
p = uintptr(sysReserve(unsafe.Pointer(p), pSize, &reserved))
- if p != 0 || GOOS == "aix" { // Useless to loop on AIX, as i is forced to 1
+ if p != 0 {
break
}
}