commit | d33a5136e1a4513a3b1deacf1cc0677e070c7e8f | [log] [tgz] |
---|---|---|
author | Cherry Mui <cherryyz@google.com> | Fri Apr 21 12:02:30 2023 -0400 |
committer | Cherry Mui <cherryyz@google.com> | Mon Apr 24 16:49:08 2023 +0000 |
tree | 49fba86e0c30b2acc7abb32069611a99d5f2afbd | |
parent | 33c06ee12a53e293f4a787c1dfde7eb7ddb0be63 [diff] |
cmd/link: use uint32 as symbol index Currently, a symbol's global index, the Sym type, is defined as an int, which is 64-bit on 64-bit machines. We're unlikely to have more than 4 billion symbols in the near future. Even if we will, we will probably hit some other limit (e.g. section size) before the symbol number limit. Use a 32-bit type to reduce memory usage. E,g, linking cmd/compile in external linking mode (on macOS/amd64) Munmap_GC 43.2M ± 0% 35.5M ± 1% -17.74% (p=0.000 n=16+20) This brings the memory usage back before the previous CL, and even lower. Change-Id: Ie185f1586638fe70d8121312bfa9410942d518c7 Reviewed-on: https://go-review.googlesource.com/c/go/+/487416 Reviewed-by: Austin Clements <austin@google.com> Run-TryBot: Cherry Mui <cherryyz@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.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 4.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://go.dev/dl/.
After downloading a binary release, visit https://go.dev/doc/install for installation instructions.
If a binary distribution is not available for your combination of operating system and architecture, visit https://go.dev/doc/install/source for source installation instructions.
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://go.dev/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://go.dev/wiki/Questions for a list of places to ask questions about the Go language.