commit | 8054b13536fc71d6f8867f90d7614de4064191ba | [log] [tgz] |
---|---|---|
author | Richard Miller <miller.research@gmail.com> | Tue Nov 19 13:15:28 2019 +0000 |
committer | David du Colombier <0intro@gmail.com> | Thu Nov 28 15:16:27 2019 +0000 |
tree | 72cb015442703e0ec00c3689cace8f1c0ef5498a | |
parent | 8a5af7910a9b157c02736c3e0998a587bb8511c1 [diff] |
runtime: on plan9 don't return substitute address for sysReserve Plan 9 doesn't have a way to reserve virtual memory, so the implementation of sysReserve allocates memory space (which won't be backed with real pages until the virtual pages are referenced). If the space is then freed with sysFree, it's not returned to the OS (because Plan 9 doesn't allow shrinking a shared address space), but it must be cleared to zeroes in case it's reallocated subsequently. This interacts badly with the way mallocinit on 64-bit machines sets up the heap, calling sysReserve repeatedly for a very large (64MB?) arena with a non-nil address hint, and then freeing the space again because it doesn't have the expected alignment. The repeated clearing of multiple megabytes adds significant startup time to every go program. We correct this by restricting sysReserve to allocate memory only when the caller doesn't provide an address hint. If a hint is provided, sysReserve will now return nil instead of allocating memory at a different address. Fixes #27744 Change-Id: Iae5a950adefe4274c4bc64dd9c740d19afe4ed1c Reviewed-on: https://go-review.googlesource.com/c/go/+/207917 Run-TryBot: David du Colombier <0intro@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David du Colombier <0intro@gmail.com>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install or load doc/install.html in your web browser for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source or load doc/install-source.html in your web browser for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.