7f32d41e5d
Currently CallersFrames expands each PC to a slice of Frames and then iteratively returns those Frames. However, this makes it very difficult to avoid heap allocation: either the Frames slice will be heap allocated, or, if it uses internal scratch space for small slices (as it currently does), the Frames object itself has to be heap allocated. Fix this, at least in the common case, by expanding each PC iteratively. We introduce a new pcExpander type that's responsible for expanding a single PC. This maintains state from one Frame to the next in the same PC. Frames then becomes a wrapper around this responsible for feeding it the next PC when the pcExpander runs out of frames for the current PC. This makes it possible to stack-allocate a Frames object, which will make it possible to use this API for PC expansion from within the runtime itself. Change-Id: I993463945ab574557cf1d6bedbe79ce7e9cbbdcd Reviewed-on: https://go-review.googlesource.com/40434 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Lazar <lazard@golang.org> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
favicon.ico | ||
LICENSE | ||
PATENTS | ||
README.md | ||
robots.txt |
The Go Programming Language
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.
Download and Install
Binary Distributions
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.
Install From Source
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.
Contributing
Go is the work of hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Note that the Go project does not use GitHub pull requests, and that we use 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.