From: Ian Lance Taylor Date: Tue, 1 Nov 2011 05:20:40 +0000 (+0000) Subject: runtime: Don't ask mmap for wrapping memory. X-Git-Tag: releases/gcc-4.7.0~2664 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=787f74b48730d896dba2d15c06a8c792d9d1af15;p=thirdparty%2Fgcc.git runtime: Don't ask mmap for wrapping memory. From-SVN: r180732 --- diff --git a/libgo/runtime/malloc.goc b/libgo/runtime/malloc.goc index f8d4327d6906..66f5bda66c0b 100644 --- a/libgo/runtime/malloc.goc +++ b/libgo/runtime/malloc.goc @@ -358,6 +358,8 @@ runtime_mallocinit(void) // away from the running binary image and then round up // to a MB boundary. want = (byte*)(((uintptr)end + (1<<18) + (1<<20) - 1)&~((1<<20)-1)); + if(0xffffffff - (uintptr)want <= bitmap_size + arena_size) + want = 0; p = runtime_SysReserve(want, bitmap_size + arena_size); if(p == nil) runtime_throw("runtime: cannot reserve arena virtual address space");