commit | 74245b03534dfec5f719aa60e03c0b932aa63e26 | [log] [tgz] |
---|---|---|
author | HÃ¥vard Haugen <havard.haugen@gmail.com> | Wed Jun 10 00:30:32 2015 +0200 |
committer | Adam Langley <agl@golang.org> | Sat Aug 29 19:23:37 2015 +0000 |
tree | caf71a9dc0825c689ff35faef74a3be15369d1ca | |
parent | ea0491b70a82a207a951f869c7c1e5a52dbf410f [diff] |
testing/quick: terminate for arbitrary recursive types Recursive types R containing slices of R's did not terminate despite the effort in CL 10821. For recursive types there was a competition between slice expansion by a factor 'complexSize', and termination with probability '1/complexSize' which lead to stack overflow as soon as a recursive struct had slices pointing to its own type. Fix this by shrinking the size hint as a function of recursion depth. This has the dual effect of reducing the number of elements generated per slice and also increasing the probability for termination. Fixes #11148. Change-Id: Ib61155b4f2e2de3873d508d63a1f4be759426d67 Reviewed-on: https://go-review.googlesource.com/13830 Reviewed-by: Adam Langley <agl@golang.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
For documentation about how to install and use Go, visit https://golang.org/ or load doc/install-source.html in your web browser.
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.
Please report issues here: https://golang.org/issue/new
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
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
If you have just untarred a binary Go distribution, you need to set the environment variable $GOROOT to the full path of the go directory (the one containing this file). You can omit the variable if you unpack it into /usr/local/go, or if you rebuild from sources by running all.bash (see doc/install-source.html). You should also add the Go binary directory $GOROOT/bin to your shell's path.
For example, if you extracted the tar file into $HOME/go, you might put the following in your .profile:
export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/bin
See https://golang.org/doc/install or doc/install.html for more details.