Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible change? #9

Open
wrnlb666 opened this issue Feb 5, 2024 · 1 comment
Open

possible change? #9

wrnlb666 opened this issue Feb 5, 2024 · 1 comment

Comments

@wrnlb666
Copy link

wrnlb666 commented Feb 5, 2024

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.

@mattn
Copy link
Owner

mattn commented Feb 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants