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

Allow struct visitors and use them for compound deserialize #100

Merged
merged 2 commits into from
Nov 19, 2022

Conversation

agocke
Copy link
Collaborator

@agocke agocke commented Nov 19, 2022

Struct visitors are useful (no allocations), but they're tricky, as side-effects may not be preserved when they are copied by the underlying deserializer.

Most importantly, a Native AOT bug
(dotnet/runtime#77070) currently causes some static abstract interface calls to fail when they have to be loaded at runtime. Generic specialization can avoid this. By using a struct visitor for some compound calls (dictionaries, enumerables, nullables) the likelihood of hitting this is reduced.

Struct visitors are useful (no allocations), but they're tricky, as
side-effects may not be preserved when they are copied by the underlying
deserializer.

Most importantly, a Native AOT bug
(dotnet/runtime#77070) currently causes some
static abstract interface calls to fail when they have to be loaded at
runtime. Generic specialization can avoid this. By using a struct
visitor for some compound calls (dictionaries, enumerables, nullables)
the likelihood of hitting this is reduced.
@agocke agocke enabled auto-merge November 19, 2022 08:22
@agocke agocke merged commit c273170 into main Nov 19, 2022
@agocke agocke deleted the allow-struct-visitors branch November 19, 2022 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant