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

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

Merged
merged 2 commits into from
Jan 23, 2024

Conversation

Sergio0694
Copy link
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
Member Author

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

image

@Sergio0694 Sergio0694 merged commit bcff01a into staging/AOT Jan 23, 2024
9 checks passed
@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