diff options
author | Austin Clements <austin@google.com> | 2016-04-13 15:06:01 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2016-04-14 21:13:23 +0000 |
commit | 8f6c35de2f7c972a4f34efddd21281b7060c4457 (patch) | |
tree | 3bf7ee2793018f228299ea9fdcfff511e158672b /src/runtime/atomic_pointer.go | |
parent | 98b6febcef8f6d7411a77e9e828df681871a28ad (diff) | |
download | go-8f6c35de2f7c972a4f34efddd21281b7060c4457.tar.gz go-8f6c35de2f7c972a4f34efddd21281b7060c4457.zip |
runtime: make sync_atomic_SwapPointer signature match sync/atomic
SwapPointer is declared as
func SwapPointer(addr *unsafe.Pointer, new unsafe.Pointer) (old unsafe.Pointer)
in sync/atomic, but defined in the runtime (where it's actually
implemented) as
func sync_atomic_SwapPointer(ptr unsafe.Pointer, new unsafe.Pointer) unsafe.Pointer
Make ptr a *unsafe.Pointer in the runtime definition to match the type
in sync/atomic.
Change-Id: I99bab651b995001bbe54f9e790fdef2417ef0e9e
Reviewed-on: https://go-review.googlesource.com/21998
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Diffstat (limited to 'src/runtime/atomic_pointer.go')
-rw-r--r-- | src/runtime/atomic_pointer.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime/atomic_pointer.go b/src/runtime/atomic_pointer.go index e9f5d03b2b..ee55de13b9 100644 --- a/src/runtime/atomic_pointer.go +++ b/src/runtime/atomic_pointer.go @@ -53,9 +53,9 @@ func sync_atomic_SwapUintptr(ptr *uintptr, new uintptr) uintptr //go:linkname sync_atomic_SwapPointer sync/atomic.SwapPointer //go:nosplit -func sync_atomic_SwapPointer(ptr unsafe.Pointer, new unsafe.Pointer) unsafe.Pointer { - old := unsafe.Pointer(sync_atomic_SwapUintptr((*uintptr)(noescape(ptr)), uintptr(new))) - writebarrierptr_nostore((*uintptr)(ptr), uintptr(new)) +func sync_atomic_SwapPointer(ptr *unsafe.Pointer, new unsafe.Pointer) unsafe.Pointer { + old := unsafe.Pointer(sync_atomic_SwapUintptr((*uintptr)(noescape(unsafe.Pointer(ptr))), uintptr(new))) + writebarrierptr_nostore((*uintptr)(unsafe.Pointer(ptr)), uintptr(new)) return old } |