From 6ebc31f9fb0ade22c605c146f651f18f9fc0b61d Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 12 Feb 2018 11:22:00 -0800 Subject: runtime: remove unused function casp Change-Id: I7c9c83ba236e1050e04377a7591fef7174df698b Reviewed-on: https://go-review.googlesource.com/130415 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- src/runtime/atomic_pointer.go | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/runtime/atomic_pointer.go') diff --git a/src/runtime/atomic_pointer.go b/src/runtime/atomic_pointer.go index 09cfbda9b1..b8f0c22c63 100644 --- a/src/runtime/atomic_pointer.go +++ b/src/runtime/atomic_pointer.go @@ -13,8 +13,6 @@ import ( // because while ptr does not escape, new does. // If new is marked as not escaping, the compiler will make incorrect // 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. // atomicwb performs a write barrier before an atomic pointer write. // The caller should guard the call with "if writeBarrier.enabled". @@ -37,17 +35,6 @@ func atomicstorep(ptr unsafe.Pointer, new unsafe.Pointer) { atomic.StorepNoWB(noescape(ptr), new) } -//go:nosplit -func casp(ptr *unsafe.Pointer, old, new unsafe.Pointer) bool { - // The write barrier is only necessary if the CAS succeeds, - // but since it needs to happen before the write becomes - // public, we have to do it conservatively all the time. - if writeBarrier.enabled { - atomicwb(ptr, new) - } - return atomic.Casp1((*unsafe.Pointer)(noescape(unsafe.Pointer(ptr))), noescape(old), new) -} - // Like above, but implement in terms of sync/atomic's uintptr operations. // We cannot just call the runtime routines, because the race detector expects // to be able to intercept the sync/atomic forms but not the runtime forms. -- cgit v1.3