Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

package runtime

import (
	
	
)
These functions cannot have go:noescape annotations, 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.
atomicwb performs a write barrier before an atomic pointer write. The caller should guard the call with "if writeBarrier.enabled".go:nosplit
func ( *unsafe.Pointer,  unsafe.Pointer) {
	 := (*uintptr)(unsafe.Pointer())
	if !getg().m.p.ptr().wbBuf.putFast(*, uintptr()) {
		wbBufFlush(, uintptr())
	}
}
atomicstorep performs *ptr = new atomically and invokes a write barrier.go:nosplit
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.
go:linkname sync_atomic_StoreUintptr sync/atomic.StoreUintptr
go:linkname sync_atomic_StorePointer sync/atomic.StorePointergo:nosplit
go:linkname sync_atomic_SwapUintptr sync/atomic.SwapUintptr
go:linkname sync_atomic_SwapPointer sync/atomic.SwapPointergo:nosplit
go:linkname sync_atomic_CompareAndSwapUintptr sync/atomic.CompareAndSwapUintptr
go:linkname sync_atomic_CompareAndSwapPointer sync/atomic.CompareAndSwapPointergo:nosplit