| commit | 0e84088715a2242fbc99b813ac25ac60b21d997a | [log] [tgz] |
|---|---|---|
| author | Russ Cox <rsc@golang.org> | Wed Jan 14 14:13:55 2015 -0500 |
| committer | Russ Cox <rsc@golang.org> | Wed Jan 14 20:46:57 2015 +0000 |
| tree | 9b28c559b88235864b5ecd596094ddbe8a624b8a | |
| parent | bfeda9188a054efdb950c9c9727d6bce7ad04961 [diff] |
runtime: change tinyalloc, persistentalloc not to point past allocated data During all.bash I got a crash in the GOMAXPROCS=2 runtime test reporting that the write barrier in the assignment 'c.tiny = add(x, size)' had been given a pointer pointing into an unexpected span. The problem is that the tiny allocation was at the end of a span and c.tiny was now pointing to the end of the allocation and therefore to the end of the span aka the beginning of the next span. Rewrite tinyalloc not to do that. More generally, it's not okay to call add(p, size) unless you know that p points at > (not just >=) size bytes. Similarly, pretty much any call to roundup doesn't know how much space p points at, so those are all broken. Rewrite persistentalloc not to use add(p, totalsize) and not to use roundup. There is only one use of roundup left, in vprintf, which is dead code. I will remove that code and roundup itself in a followup CL. Change-Id: I211e307d1a656d29087b8fd40b2b71010722fb4a Reviewed-on: https://go-review.googlesource.com/2814 Reviewed-by: Dmitry Vyukov <dvyukov@google.com>
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.