Commit fb9fd2bd authored by Austin Clements's avatar Austin Clements

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/8831Reviewed-by: 's avatarRick Hudson <rlh@golang.org>
parent 918fdae3
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment