github.com/go-ng/xatomic@v0.0.0-20230519181013-85c0ec87e55f/common.go (about) 1 package xatomic 2 3 import "unsafe" 4 5 func unref(p unsafe.Pointer) unsafe.Pointer { 6 return *(*unsafe.Pointer)(p) 7 } 8 9 func ref(p unsafe.Pointer) unsafe.Pointer { 10 return unsafe.Pointer(&p) 11 }