-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Update UnmanagedCallersOnlyAttribute to align with C# function pointers #37612
Comments
No types corresponds to We can't easily expose convenience constructors that take |
That's correct. If we have to understand that enum, it defeats the purpose of having an extensible calling convention protocol in the first place :). |
Correct.
I realize that this is part of the function pointers discussion, but will call out that marking the function |
@tannergooding and @333fred Thoughts on changing the |
Maybe |
However many 🚲s you want to 🏠 (no :shed: 🙁) is fine with me. So long as there's an array of types that matches up to what we need to emit. |
I know I'm a bit too late (API is already approved), but here's my 2 cents: I'd name it |
FWIW, |
@nathan-alden-sr It is correct in the official name - https://github.com/dotnet/runtime/blob/master/src/libraries/System.Private.CoreLib/src/System/Runtime/InteropServices/SuppressGCTransitionAttribute.cs. I am just poor at spelling in comments 😄 |
Background and Motivation
The C# function pointers proposal will be consuming new types as a means to indicate future calling conventions. See discussion about calling conventions with
CallConvXXX
referenced in dotnet/roslyn#39865.Original API review: #32462
Proposed API
The existing API below uses the
CallingConvention
enumeration. This enumeration is tailored for a 32-bit Windows world. This severely limits the growth of this API.The updated API would change the
CallingConvention
field to beType[] CallConvs
which is more flexible as new calling conventions are adopted.Usage Examples
Old:
New:
Note It would be requested that the Roslyn compiler apply the same validation algorithm applied in the function pointers specification to the types in the
CallConvs
array.Risks
If this work is not done for .NET 5 updating the
UnmanagedCallersOnlyAttribute
will become substantially more difficult.The text was updated successfully, but these errors were encountered: