You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Refactor AOTCompilerTools to hide implementation #800
I have verified that I am running the latest version of ImageSharp
I have verified if the problem exist in both DEBUG and RELEASE mode
I have searched open and closed issues to ensure it has not already been reported
Description
This is related to a lot of the AOT -> JIT bugs that have been written lately... I've been looking into iOS AOT errors more, and found some documentation of how to solve them (in the Unity docs of all places):
ImageSharp has the AOTCompilerTools.Seed<TPixel>() method that can be called to pre-seed the AOT compiler, however that method never actually has to be called. I've verified that a call to that method only has to exist in the codebase with the correct generic type, and the AOT compiler will pick it up:
private static void NeverCallThisMethod()
{
AotCompilerTools.Seed<Rgba32>();
throw new Exception("Don't call AotCompilerTools.NeverCallThisMethod(), it only exists to preseed the AOT compiler.");
}
^ This totally works, and wouldn't force ImageSharp users to use troubleshoot confusing AOT compiler errors. I'd be happy to clean up this code and create a PR for it.
Steps to Reproduce
System Configuration
ImageSharp version: This is on the tip of master
Other ImageSharp packages and versions:
Environment (Operating system, version and so on): iOS
Activity
antonfirsov commentedon Dec 29, 2018
@dmanning23 thanks for investigating this!
I think we will drop those methods from the public API before 1.0.
/cc @swoolcock