Descriptionruntime: be explicit about the reservation of all the memory behind the heap
Various parts of the runtime use "sizeof(void*) == 8 && (uintptr)v >= 0xffffffffU" to try to determine if we are in "64-bit" or "32-bit" mode for allocation, the main difference between the modes being whether the heap has all its address space allocated to it by the kernel or not yet.
As well as being mighty obscure, this can be _wrong_: if the attempt to map the heap around 0xc000000000 fails on a 64-bit system, we switch to the "32-bit" mode for allocating the heap, and it's perfectly possible for this heap to still end up way beyond 0xffffffffU.
I found this on aarch64, where only 512Gb of address space is available to a process and so clearly we should try to put the heap somewhere else; this is still a bug though.
The bug is present in the go distribution too.
This code is not really a serious attempt at a fix, I'm only just compiling it now. Thoughts welcome though!
Fixes issue 6926
Patch Set 1 #Patch Set 2 : diff -r ba0adcfb4e6a https://code.google.com/p/gofrontend/ #Patch Set 3 : diff -r ba0adcfb4e6a https://code.google.com/p/gofrontend/ #
MessagesTotal messages: 3
|