-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add UnmanagedCallConvAttribute #52869
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
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, to please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
58d494e to
26651ea
Compare
I would not bother with implementing the advanced calling conventions for delegates. I think we should make everybody who needs to do interop with function pointers to use function pointers. |
26651ea to
8b36d39
Compare
lambdageek
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.
It would be great if the mono code could avoid managed allocation to decode the custom attribute. That would make it usable for AOT compilation. If that turns out not to work, we should still take the code, disabled, and do a follow-up fix to mono_reflection_create_custom_attr_data_args_noalloc to make it work.
src/tests/Interop/UnmanagedCallConv/UnmanagedCallConvNative.cpp
Outdated
Show resolved
Hide resolved
I am okay with this also. I would like to see us error out though if it is set on a |
If you try to use this on a Delegate, the compiler will produce an error thanks to |
031a0f2 to
7151dc7
Compare
lambdageek
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.
mono bits lgtm
|
All the tests passed - failure was from uploading results ( |
Fixes #51156
UnmanagedCallConvAttributeUnmanagedCallConvif the calling convention is not specified or specified aswinapion pinvokeimpl metadataCallConvSuppressGCTransitioncan be specifiedUnmanagedCallersOnly- since we don't include the support to read a type array, make crossgen bail if the method is markedUnmanagedCallConvThis does not implement checking of
UnmanagedCallConvfor delegates.cc @AaronRobinsonMSFT @jkoritzinsky