diff -r 250b34075533 libgo/runtime/malloc.goc --- a/libgo/runtime/malloc.goc Mon Oct 31 21:54:06 2011 -0700 +++ b/libgo/runtime/malloc.goc Mon Oct 31 22:18:21 2011 -0700 @@ -358,6 +358,8 @@ // 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");