-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
feat(ext/ffi): Implement UnsafePointer
and UnsafePointerView
API
#12828
Conversation
This pr could very easily implement |
I'm not sure using f64's is sound. V8 tends to canonicalize NaNs - maybe Infs and subnormals too, but definitely NaNs - which means there's a subset of the 64 bit space that's going to get corrupted. You could maybe get away with it if it's only NaNs and Infs1 but definitely not when it's subnormals too. An example of a subnormal is tl;dr Don't rely on V8 leaving the top 12 bits untouched, use BigInts instead. 1 ARM64 and x86_64 have up to 52 address lines, which is exactly the f64 significand's size. NaNs and Infs are encoded in the exponent, not the significand. |
@bnoordhuis internally pointers are now represented as the high and low bytes of an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, got a few comments
UnsafePointer
and UnsafePointerView
API
This PR is ready for review now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. Mostly LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Elias, LGTM.
What next release can we expect this to land in? v1.17.0? When is that expected to land? https://github.com/denoland/deno/milestone/28 currently says "past due 1 day" as of 2021-12-15 excited for this to land!!! |
Yes, it's going to be in 1.17.0 release which is a bit delayed it seems. Can expect it in a day or two I think |
@DjDeveloperr It is not delayed. 1.17.0 will release tomorrow as documented in the release schedule: https://deno.land/manual@v1.16.4/contributing/release_schedule. I have updated the milestone accordingly now. |
This pr adds support for passing, returning and reading pointers as proposed by the
UnsafePointer
andUnsafePointerView
api (#12824).Closes #12809, #12456, #12824 and #12752