Commit 8cda97ab by Ian Lance Taylor

runtime: update AIX memory allocation for new versions

    
    Reviewed-on: https://go-review.googlesource.com/97357

From-SVN: r258052
parent 930540ca
bd7fc3c85d874344b18bbb0a738ec94dfb43794b 821960465883fbdd96568f2325f55ee4b05de1cb
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -296,8 +296,8 @@ func mallocinit() { ...@@ -296,8 +296,8 @@ func mallocinit() {
// allocation at 0x40 << 32 because when using 4k pages with 3-level // allocation at 0x40 << 32 because when using 4k pages with 3-level
// translation buffers, the user address space is limited to 39 bits // translation buffers, the user address space is limited to 39 bits
// On darwin/arm64, the address space is even smaller. // On darwin/arm64, the address space is even smaller.
// On AIX, mmap adresses range start at 0x07000000_00000000 for 64 bits // On AIX, mmap adresses range starts at 0x0700000000000000 for 64-bit
// processes. // processes. The new address space allocator starts at 0x0A00000000000000.
arenaSize := round(_MaxMem, _PageSize) arenaSize := round(_MaxMem, _PageSize)
pSize = bitmapSize + spansSize + arenaSize + _PageSize pSize = bitmapSize + spansSize + arenaSize + _PageSize
for i := 0; i <= 0x7f; i++ { for i := 0; i <= 0x7f; i++ {
...@@ -307,13 +307,16 @@ func mallocinit() { ...@@ -307,13 +307,16 @@ func mallocinit() {
case GOARCH == "arm64": case GOARCH == "arm64":
p = uintptr(i)<<40 | uintptrMask&(0x0040<<32) p = uintptr(i)<<40 | uintptrMask&(0x0040<<32)
case GOOS == "aix": case GOOS == "aix":
i = 1 if i == 0 {
p = uintptr(i)<<32 | uintptrMask&(0x70<<52) p = uintptrMask&(1<<32) | uintptrMask&(0xa0<<52)
} else {
p = uintptr(i)<<32 | uintptrMask&(0x70<<52)
}
default: default:
p = uintptr(i)<<40 | uintptrMask&(0x00c0<<32) p = uintptr(i)<<40 | uintptrMask&(0x00c0<<32)
} }
p = uintptr(sysReserve(unsafe.Pointer(p), pSize, &reserved)) 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 break
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment