Skip to content
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

mono: Implement support for generic unmanaged calli #98819

Closed
2 tasks
hez2010 opened this issue Feb 22, 2024 · 3 comments
Closed
2 tasks

mono: Implement support for generic unmanaged calli #98819

hez2010 opened this issue Feb 22, 2024 · 3 comments
Labels
area-Codegen-meta-mono User Story A single user-facing feature. Can be grouped under an epic.
Milestone

Comments

@hez2010
Copy link
Contributor

hez2010 commented Feb 22, 2024

As per #97079 (comment)
We have implemented support for generic unmanaged calli in both CoreCLR and NativeAOT. We should also implement it for mono.

Work items:

  • Support generic unmanaged calli for blittable types
  • Enabling generic unmanaged calli can technically enable generic varargs as well, make sure to block generic varargs usage ( in CoreCLR we throw a NotSupportedException).

Optional:

  • Add an error mode to throw MarshalDirectiveException for runtime marshaling (i.e. generic unmanaged calli with non-blittable types). Note that NativeAOT doesn't verify this and will simply produce bad codegen.

After the implementation, we will also need to re-enable tests for generic calli in src/tests/Interop/Interop.csproj.

And we are skipping tests on mono, make sure to enable them as well: https://github.com/dotnet/runtime/blob/main/src%2Ftests%2FInterop%2FMarshalAPI%2FFunctionPointer%2FGenericFunctionPointer.cs#L11-L12

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Feb 22, 2024
@jkotas jkotas changed the title mono: Implement support for generic calli mono: Implement support for generic unmanaged calli Feb 22, 2024
@lambdageek lambdageek added area-Codegen-meta-mono and removed area-Interop-mono untriaged New issue has not been triaged by the area owner labels Feb 22, 2024
@lambdageek lambdageek added this to the 9.0.0 milestone Feb 22, 2024
@lambdageek
Copy link
Member

/cc @steveisok @vargaz

@vargaz
Copy link
Contributor

vargaz commented Mar 6, 2024

With the PRs above, this should mostly work now.

@hez2010
Copy link
Contributor Author

hez2010 commented Mar 16, 2024

@vargaz vargaz removed their assignment Mar 22, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Codegen-meta-mono User Story A single user-facing feature. Can be grouped under an epic.
Projects
None yet
Development

No branches or pull requests

6 participants
@vargaz @steveisok @lambdageek @jkotas @hez2010 and others