-
Notifications
You must be signed in to change notification settings - Fork 846
[FS-1044] Add NativePtr.toByRef #3691
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
Conversation
|
I think it is a good addition 👍, but I'd suggest to name it I don't know whether the compiled name should include the suffix |
|
@abelbraaksma I have changed the name as suggested. I included the suffix |
|
Before @dsyme or @KevinRansom can merge this, you should probably fix the tests. I didn't check, but perhaps the surface area changed (there's a test that deliberately fails each time a public method is added, changed, removed)? I am not 100% sure what is required to add public methods to the core in terms of procedure. |
|
Thanks @abelbraaksma, I had a look through the tests and there doesn't appear to be a single place in which the |
|
Some tests come up in this search: https://github.com/Microsoft/visualfsharp/search?utf8=%E2%9C%93&q=NativePtr&type= |
|
I've updated the tests, thanks. No idea why the CI builds are failing, tho. |
|
There is a similar method in System.Runtime.CompilerServices.Unsafe here, which has a nontrivial implementation for non .NET core (does a round-trip via a local). Is there any chance the same thing applies here? |
|
@dotnet-bot test this please |
|
Triggering test because details ain't available. |
|
@mjmckp please rename the PR name to respect the changed naming. |
|
@KevinRansom F# 4.3 ? |
|
Approved. But this should have a tracking RFC too
@realvictorprm "F# SDK 4.3" means F# 4.1 with FSharp.Core 4.4.3.0 and updated compiler |
KevinRansom
left a comment
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 for this contribution
The
toByrefmethod fills a gap in theNativePtrmodule - converting typed native pointers to byref pointers. This is necessary, e.g., to call methods such asThread.VolatileReadorThread.VolatileWrite. This method was originally proposed here #409 but wasn't incorporated into theNativePtrmodule.RFC https://github.com/fsharp/fslang-design/blob/master/RFCs/FS-1044-add-nativeptr-tobyref.md