mirror of https://github.com/golang/go.git
runtime: atomic ops for int64
These currently use portable implementations in terms of their uint64 counterparts. Change-Id: Icba5f7134cfcf9d0429edabcdd73091d97e5e905 Reviewed-on: https://go-review.googlesource.com/8831 Reviewed-by: Rick Hudson <rlh@golang.org>
This commit is contained in:
parent
918fdae348
commit
fb9fd2bdd7
|
|
@ -151,6 +151,22 @@ func atomicloaduintptr(ptr *uintptr) uintptr
|
|||
//go:noescape
|
||||
func atomicloaduint(ptr *uint) uint
|
||||
|
||||
// TODO: Write native implementations of int64 atomic ops (or improve
|
||||
// inliner). These portable ones can't be inlined right now, so we're
|
||||
// taking an extra function call hit.
|
||||
|
||||
func atomicstoreint64(ptr *int64, new int64) {
|
||||
atomicstore64((*uint64)(unsafe.Pointer(ptr)), uint64(new))
|
||||
}
|
||||
|
||||
func atomicloadint64(ptr *int64) int64 {
|
||||
return int64(atomicload64((*uint64)(unsafe.Pointer(ptr))))
|
||||
}
|
||||
|
||||
func xaddint64(ptr *int64, delta int64) int64 {
|
||||
return int64(xadd64((*uint64)(unsafe.Pointer(ptr)), delta))
|
||||
}
|
||||
|
||||
//go:noescape
|
||||
func setcallerpc(argp unsafe.Pointer, pc uintptr)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue