Skip to content

Conversation

@Sergio0694
Copy link
Member

Second attempt from #1399 😄

This PR makes the exported DllGetActivationFactory zero-alloc, skipping the useless string runtimeClassId parameter.
It does so by leveraging the new MarshalString.FromAbiUnsafe API added in #1400, and it updates the generated Module type so that when not on .NET Standard, the GetActivationFactory method will actually take a ReadOnlySpan<char> parameter (with a second string overload just forwarding to it). The new native exports for NativeAOT can then just call this new ReadOnlySpan<char> overload using the new FromAbiUnsafe marshalling method.

@Sergio0694 Sergio0694 added performance Related to performance work gc Related to garbage collection authoring Related to authoring feature work AOT labels Nov 30, 2023
@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/marshal-string-span branch from f73316f to ea406bd Compare December 1, 2023 01:22
@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/naot-winrt-exports branch 2 times, most recently from fa62a4c to f02bf33 Compare January 9, 2024 00:27
@Sergio0694 Sergio0694 changed the base branch from user/sergiopedri/naot-winrt-exports to staging/AOT January 10, 2024 11:19
@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/marshal-string-span branch from ea406bd to 9a1ab96 Compare January 10, 2024 11:20
@Sergio0694 Sergio0694 marked this pull request as ready for review January 10, 2024 11:22
@Sergio0694 Sergio0694 force-pushed the user/sergiopedri/marshal-string-span branch from fe3f4b2 to 768dbf3 Compare January 12, 2024 18:58
@Sergio0694 Sergio0694 merged commit 69b8ff6 into staging/AOT Jan 25, 2024
@Sergio0694 Sergio0694 deleted the user/sergiopedri/marshal-string-span branch January 25, 2024 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AOT authoring Related to authoring feature work gc Related to garbage collection performance Related to performance work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants