-
Notifications
You must be signed in to change notification settings - Fork 5k
Add ImmutableCollectionsMarshal type and AsImmutableArray/AsArray APIs #85526
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
Add ImmutableCollectionsMarshal type and AsImmutableArray/AsArray APIs #85526
Conversation
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, 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. |
Tagging subscribers to this area: @dotnet/area-system-reflection-metadata Issue DetailsCloses #83141 OverviewThis PR adds the following new APIs to System.Collections.Immutable: namespace System.Runtime.InteropServices;
public static class ImmutableCollectionsMarshal
{
public static ImmutableArray<T> AsImmutableArray<T>(T[]? array);
public static T[]? AsArray<T>(ImmutableArray<T> array);
} I also updated some code in System.Reflection.Metadata to use these and drop the internal helpers that were used.
|
Thanks! Can you please also delete https://github.com/dotnet/runtime/blob/0c612cf7c36f53651e646d62d3bb362823880c00/src/libraries/System.Collections.Immutable/src/System/Collections/Frozen/ImmutableArrayFactory.cs and fix up the uses to use the new public API instead? |
Ooh, missed that one, thank you! Done in 3f53f2c. |
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!
Closes #83141
Overview
This PR adds the following new APIs to System.Collections.Immutable:
I also updated some code in System.Reflection.Metadata to use these and drop the internal helpers that were used.