-
Notifications
You must be signed in to change notification settings - Fork 47
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
11.10节, uintptr 暂存到变量, golang文档不建议 #6
Comments
文档不建议是针对新手,这个报告的题目是深入cgo编程。 unsafe包同样是不安全的,但是很多场景我们都喜欢这个不安全。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note that both conversions must appear in the same expression, with only the intervening arithmetic between them:
// INVALID: uintptr cannot be stored in variable
// before conversion back to Pointer.
u := uintptr(p)
p = unsafe.Pointer(u + offset)
The text was updated successfully, but these errors were encountered: