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

Solves AOT compilation issue for Unity - iOS #394

Merged
merged 1 commit into from May 21, 2015

Conversation

rgarat
Copy link
Contributor

@rgarat rgarat commented May 15, 2015

When using protobuf c# in unity for building iOS there is an issue with AOT compilation

---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Collections.Generic.EqualityComparer1 ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ExecutionEngineException: Attempting to JIT compile method 'System.Collections.Generic.GenericEqualityComparer1:.ctor ()' while running with --aot-only.

The solution is to provide a concrete implementation of IEqualityComparer to avoid AOT compilation.

More references for this issue:
http://stackoverflow.com/questions/24368929/exception-attempting-to-jit-compile-method-while-running-with-aot-only-with
https://code.google.com/p/protobuf-csharp-port/issues/detail?id=98

@jtattermusch jtattermusch self-assigned this May 16, 2015

internal class ExtensionIntPairEqualityComparer : IEqualityComparer<ExtensionIntPair>
{
public bool Equals (ExtensionIntPair x, ExtensionIntPair y)
Copy link
Contributor

Choose a reason for hiding this comment

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

code style: please remove the extra space between "Equals" and "(". Also below

…ExtensionRegistryLite.cs to prevent AOT compilation issue with unity in iOS
@rgarat
Copy link
Contributor Author

rgarat commented May 21, 2015

@jtattermusch I made the changes you requested, please let me know if you need me to make any more changes

@jtattermusch
Copy link
Contributor

Hi, yes, I saw, thanks. There's nothing else I need from you, it's just I am fully focused on gRPC alpha release for the past few days, sorry for the delay.

@jskeet feel free to to review and merge this if it looks good.

@jtattermusch
Copy link
Contributor

LGTM.

jtattermusch added a commit that referenced this pull request May 21, 2015
Solves AOT compilation issue for Unity - iOS
@jtattermusch jtattermusch merged commit 3668a22 into protocolbuffers:master May 21, 2015
taoso pushed a commit to taoso/protobuf that referenced this pull request Aug 1, 2018
Properly unmarshal JSON "null" field value to nil for all WKTs except for Value type.  This is consistent with regular message field types.
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.

None yet

4 participants