Skip to content

Allows client code to avoid tripping over StandardResolver#1315

Merged
AArnott merged 1 commit intoMessagePack-CSharp:developfrom
AArnott:fix832
Sep 2, 2021
Merged

Allows client code to avoid tripping over StandardResolver#1315
AArnott merged 1 commit intoMessagePack-CSharp:developfrom
AArnott:fix832

Conversation

@AArnott
Copy link
Copy Markdown
Collaborator

@AArnott AArnott commented Aug 22, 2021

In AOT-only environments it seems it was impossible to avoid loading StandardResolver because the MessagePackSerializer had a static property with an initializer that loaded the StandardResolver.
After this change, if the DefaultOptions getter is never called, or its setter is called first, then the StandardResolver can be avoided.

Fixes #832

@AArnott AArnott added this to the v2.4 milestone Aug 22, 2021
@AArnott AArnott requested a review from neuecc August 22, 2021 00:03
@AArnott AArnott self-assigned this Aug 22, 2021
In AOT-only environments it seems it was impossible to avoid loading `StandardResolver` because the `MessagePackSerializer` had a static property with an initializer that loaded the `StandardResolver`.
After this change, if the `DefaultOptions` getter is never called, or its setter is called first, then the `StandardResolver` can be avoided.

Fixes MessagePack-CSharp#832
Copy link
Copy Markdown
Member

@neuecc neuecc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
I often work on issues related to AOT and loading, but I think more carefully about these patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants