OSDN Git Service

runtime: Don't ask mmap for wrapping memory.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Nov 2011 05:20:40 +0000 (05:20 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Nov 2011 05:20:40 +0000 (05:20 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180732 138bc75d-0d04-0410-961f-82ee72b054a4

libgo/runtime/malloc.goc

index f8d4327..66f5bda 100644 (file)
@@ -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");