Skip to content

mono: Implement support for generic unmanaged calli #98819

Closed

Description

@hez2010

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

Activity

  1. ghost added
    untriaged
    on Feb 22, 2024
  2. changed the title [-]mono: Implement support for generic calli[/-] [+]mono: Implement support for generic unmanaged calli[/+] on Feb 22, 2024
  3. added and removed
    untriaged
    on Feb 22, 2024
  4. added this to the 9.0.0 milestone on Feb 22, 2024
  5. lambdageek commented on Feb 22, 2024

    @lambdageek
    Member
  6. added
    User Story
    on Feb 26, 2024
  7. vargaz commented on Mar 6, 2024

    @vargaz
    Contributor

    With the PRs above, this should mostly work now.

  8. hez2010 commented on Mar 16, 2024

    @hez2010
    ContributorAuthor
  9. removed their assignment
    on Mar 22, 2024
  10. locked and limited conversation to collaborators on Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    User Storyarea-Codegen-meta-mono

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions