Skip to content

Make marshalling 'System.Type' AOT-safe#1459

Merged
Sergio0694 merged 2 commits into
staging/AOTfrom
user/sergiopedri/aot-safe-type-marshalling
Jan 23, 2024
Merged

Make marshalling 'System.Type' AOT-safe#1459
Sergio0694 merged 2 commits into
staging/AOTfrom
user/sergiopedri/aot-safe-type-marshalling

Conversation

@Sergio0694
Copy link
Copy Markdown
Member

Contributes to #1324

While enabling the AOT analyzers, I noticed that marshalling System.Type was inherently not AOT-safe. Because this is a well known type, we can drop using MarshalNonBlittable<T> for it (as this is just not AOT-safe at all), and hardcode the right marshalling stubs instead, since we do know the ABI type at compile time in this case.

Opening this PR first to split the work. Will finish adding all AOT annotations in a follow up PR.

@Sergio0694
Copy link
Copy Markdown
Member Author

Regresses size by 1 KB, but it makes Type marshalling AOT safe and faster, I'll take it 😄

image

Comment thread src/WinRT.Runtime/FundamentalMarshalers.cs Outdated
@Sergio0694 Sergio0694 merged commit bcff01a into staging/AOT Jan 23, 2024
@Sergio0694 Sergio0694 deleted the user/sergiopedri/aot-safe-type-marshalling branch January 23, 2024 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants