]> Cypherpunks repositories - gostls13.git/commit
runtime: fall back to small mmaps if we fail to grow reservation
authorAustin Clements <austin@google.com>
Fri, 28 Jul 2017 22:06:03 +0000 (18:06 -0400)
committerAustin Clements <austin@google.com>
Mon, 31 Jul 2017 14:05:58 +0000 (14:05 +0000)
commit780249eed449ea8ae63f0dec258c55381f30173b
treedbebe57c9187c1982fc822c582b2107f50d9c427
parent31b2c4cc255b98e4255854a008c0c9b53ad4fd26
runtime: fall back to small mmaps if we fail to grow reservation

Right now, if it's possible to grow the arena reservation but
mheap.sysAlloc fails to get 256MB more of memory, it simply fails.
However, on 32-bit we have a fallback path that uses much smaller
mmaps that could take in this situation, but fail to.

This commit fixes mheap.sysAlloc to use a common failure path in case
it can't grow the reservation. On 32-bit, this path includes the
fallback.

Ideally, mheap.sysAlloc would attempt smaller reservation growths
first, but taking the fallback path is a simple change for Go 1.9.

Updates #21044 (fixes one of two issues).

Change-Id: I1e0035ffba986c3551479d5742809e43da5e7c73
Reviewed-on: https://go-review.googlesource.com/51713
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/malloc.go