diff options
Diffstat (limited to 'libgo/go/runtime/mpagealloc.go')
-rw-r--r-- | libgo/go/runtime/mpagealloc.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libgo/go/runtime/mpagealloc.go b/libgo/go/runtime/mpagealloc.go index dac1f39..071f1fc 100644 --- a/libgo/go/runtime/mpagealloc.go +++ b/libgo/go/runtime/mpagealloc.go @@ -395,6 +395,9 @@ func (p *pageAlloc) grow(base, size uintptr) { // Store it atomically to avoid races with readers which // don't acquire the heap lock. r := sysAlloc(unsafe.Sizeof(*p.chunks[0]), p.sysStat) + if r == nil { + throw("pageAlloc: out of memory") + } atomic.StorepNoWB(unsafe.Pointer(&p.chunks[c.l1()]), r) } p.chunkOf(c).scavenged.setRange(0, pallocChunkPages) |