Various fixes for AOT compilation#110
Open
Cidolfas wants to merge 11 commits into
Open
Conversation
added 11 commits
December 30, 2023 22:08
… defined in user assemblies
…time during AOT-mode
I find that the custom assembly resolver kills perf during Unity play-in-editor startup
The unmanaged constraint that ReinterpretFormatter has on T will cause the compiler to reject those The C# runtime doesn't seem to enforce that rule, so the change only affects AOT generated code
I'm not positive if it was actually variable boxing, but I was getting an issue where the value of offset would roll back to the value it was at the last time the specific SerializeDelegate for that type was used, which would then blow up on deserialization. Moving the args definition inside the delegate body fixes it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was evaluating Ceras for a project that's currently still on Unity 2019.4 in .NET standard 2.0 mode, and I figured I'd go ahead and share all the work I had to do to get AOT compilation to work properly for it.
Most of these things are just small bugs, but a few of them veer into new feature territory (like generating formatters for subclasses of an abstract base class).
I don't expect to do much more work here, and since this repo hasn't been updated in a few years I'm mostly just leaving it for anybody in the future who runs into these issues.