diff options
| author | Filippo Valsorda <filippo@golang.org> | 2018-09-06 13:25:27 -0400 |
|---|---|---|
| committer | Filippo Valsorda <filippo@golang.org> | 2018-09-06 13:25:27 -0400 |
| commit | 4d1aa482b8754c081d8f3f6b39fe61dd2e6504fc (patch) | |
| tree | b12a76ad02035d1206d09a7aa14a6cda0c411c3c /src/runtime/atomic_pointer.go | |
| parent | 7eb1677c01c3decc510270d532ed69d0bf42bffa (diff) | |
| parent | 3e5b5d69dcdb82494f550049986426d84dd6b8f8 (diff) | |
| download | go-4d1aa482b8754c081d8f3f6b39fe61dd2e6504fc.tar.xz | |
[dev.boringcrypto] all: merge master into dev.boringcrypto
Change-Id: Ia8ddd4e52dcfe87f9daef2edd37c8155fcae7f5a
Diffstat (limited to 'src/runtime/atomic_pointer.go')
| -rw-r--r-- | src/runtime/atomic_pointer.go | 13 |
1 files changed, 0 insertions, 13 deletions
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. |
