sing/common/unsafe.go
2022-01-29 03:25:38 +08:00

11 lines
239 B
Go

package common
import "unsafe"
func PointerOf(reference any) uintptr {
return (uintptr)(unsafe.Pointer(reference.(*interface{})))
}
func PointerEquals(reference any, other any) bool {
return PointerOf(reference) == PointerOf(other)
}