summaryrefslogtreecommitdiff
path: root/src/runtime/mgc0.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-10-14 23:24:32 -0400
committerRuss Cox <rsc@golang.org>2014-10-14 23:24:32 -0400
commita789400a8e4b1ad09076edacc1efeaef2446e619 (patch)
tree8e99c8a96145c57ef921676516317231c83e6a9d /src/runtime/mgc0.go
parent3d4a92a2e6eb8efa60e84bd53be2280288e0bf2f (diff)
downloadgo-a789400a8e4b1ad09076edacc1efeaef2446e619.tar.gz
cmd/gc, runtime: fix race, nacl for writebarrier changes
The racewalk code was not updated for the new write barriers. Make it more future-proof. The new write barrier code assumed that +1 pointer would be aligned properly for any type that might follow, but that's not true on 32-bit systems where some types are 64-bit aligned. The only system like that today is nacl/amd64p32. Insert a dummy pointer so that the ambiguously typed value is at +2 pointers, which is always max-aligned. LGTM=r R=r CC=golang-codereviews, iant, khr https://codereview.appspot.com/158890046
Diffstat (limited to 'src/runtime/mgc0.go')
-rw-r--r--src/runtime/mgc0.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/mgc0.go b/src/runtime/mgc0.go
index 3152b1fe1..3a7204b54 100644
--- a/src/runtime/mgc0.go
+++ b/src/runtime/mgc0.go
@@ -110,20 +110,20 @@ func writebarrieriface(dst *[2]uintptr, src [2]uintptr) {
}
//go:nosplit
-func writebarrierfat2(dst *[2]uintptr, src [2]uintptr) {
+func writebarrierfat2(dst *[2]uintptr, _ *byte, src [2]uintptr) {
dst[0] = src[0]
dst[1] = src[1]
}
//go:nosplit
-func writebarrierfat3(dst *[3]uintptr, src [3]uintptr) {
+func writebarrierfat3(dst *[3]uintptr, _ *byte, src [3]uintptr) {
dst[0] = src[0]
dst[1] = src[1]
dst[2] = src[2]
}
//go:nosplit
-func writebarrierfat4(dst *[4]uintptr, src [4]uintptr) {
+func writebarrierfat4(dst *[4]uintptr, _ *byte, src [4]uintptr) {
dst[0] = src[0]
dst[1] = src[1]
dst[2] = src[2]