aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/atomic_pointer.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2016-04-13 11:13:39 -0400
committerAustin Clements <austin@google.com>2016-04-13 16:06:51 +0000
commitd8e8fc292ace5ae59a0da44dfca1dd5b1a71ecf1 (patch)
tree50270ff31b042abfd057be10b9208953087b59c5 /src/runtime/atomic_pointer.go
parent6b85a45edc94786c7669823ee47a6ce1156d6a9a (diff)
downloadgo-d8e8fc292ace5ae59a0da44dfca1dd5b1a71ecf1.tar.gz
go-d8e8fc292ace5ae59a0da44dfca1dd5b1a71ecf1.zip
runtime/internal/atomic: remove write barrier from Storep1 on s390x
atomic.Storep1 is not supposed to invoke a write barrier (that's what atomicstorep is for), but currently does on s390x. This causes a panic in runtime.mapzero when it tries to use atomic.Storep1 to store what's actually a scalar. Fix this by eliminating the write barrier from atomic.Storep1 on s390x. Also add some documentation to atomicstorep to explain the difference between these. Fixes #15270. Change-Id: I291846732d82f090a218df3ef6351180aff54e81 Reviewed-on: https://go-review.googlesource.com/21993 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Michael Munday <munday@ca.ibm.com>
Diffstat (limited to 'src/runtime/atomic_pointer.go')
-rw-r--r--src/runtime/atomic_pointer.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/runtime/atomic_pointer.go b/src/runtime/atomic_pointer.go
index bd21b49945..d54f1d6eef 100644
--- a/src/runtime/atomic_pointer.go
+++ b/src/runtime/atomic_pointer.go
@@ -15,10 +15,9 @@ import (
// escape analysis decisions about the pointer value being stored.
// Instead, these are wrappers around the actual atomics (casp1 and so on)
// that use noescape to convey which arguments do not escape.
-//
-// Additionally, these functions must update the shadow heap for
-// write barrier checking.
+// atomicstorep performs *ptr = new atomically and invokes a write barrier.
+//
//go:nosplit
func atomicstorep(ptr unsafe.Pointer, new unsafe.Pointer) {
atomic.Storep1(noescape(ptr), new)