mattn/go-pointer

possible change?

Opened this issue · 1 comments

With go1.21 on my machine, it is allowed to convert a dangling pointer/address to uintptr then to unsafe.Pointer like so var ptr unsafe.Pointer = unsafe.Pointer(uintptr(1)). And I think it would be a performace boost if avoiding memory allocation.

No, Go check the pointer is Go's pointer. See https://pkg.go.dev/cmd/cgo#hdr-Passing_pointers