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

Various fixes for AOT compilation #110

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Cidolfas
Copy link

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.

Alex Swaim added 11 commits December 30, 2023 22:08
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
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.

None yet

1 participant