Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(180)

Issue 40610044: code review 40610044: runtime: be explicit about whether all the memory behin... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 5 months ago by mwhudson
Modified:
10 years, 2 months ago
Reviewers:
dave, gofrontend-dev
Visibility:
Public.

Description

runtime: 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/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -15 lines) Patch
M libgo/runtime/malloc.h View 1 2 chunks +3 lines, -2 lines 0 comments Download
M libgo/runtime/malloc.goc View 1 7 chunks +15 lines, -6 lines 0 comments Download
M libgo/runtime/mem.c View 1 4 chunks +4 lines, -4 lines 0 comments Download
M libgo/runtime/mem_posix_memalign.c View 1 1 chunk +4 lines, -2 lines 0 comments Download
M libgo/runtime/mgc0.c View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3
mwhudson
Hello gofrontend-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/gofrontend/
10 years, 5 months ago (2013-12-11 02:45:40 UTC) #1
dave_cheney.net
On 2013/12/11 02:45:40, mwhudson wrote: > Hello mailto:gofrontend-dev@googlegroups.com, > > I'd like you to review ...
10 years, 5 months ago (2013-12-11 02:49:08 UTC) #2
mwhudson
10 years, 5 months ago (2013-12-11 08:56:17 UTC) #3
On 2013/12/11 02:49:08, dfc wrote:
> On 2013/12/11 02:45:40, mwhudson wrote:
> > Hello mailto:gofrontend-dev@googlegroups.com,
> > 
> > I'd like you to review this change to
> > https://code.google.com/p/gofrontend/
> 
> Thanks Michael, 
> 
> iant/michael: I'm wonding if this should land in Go first, then be backported
to
> gccgo

Yes, probably.  I'll send something to golang-dev tomorrow.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b