2025-06-07 17:43:34 +08:00

30 lines
1013 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
namespace AOT
{
/// <summary>
/// 优化HybridCLR相关
/// 频繁使用的泛型在此类中显示调用然后走IL2CPP泛型共享机制不走HybridCLR解释执行,性能更优
/// 如果managed strip level开得高可能会导致有的程序集即使在link文件中保留依然被裁掉我们需要在代码中显示调用这些程序集中的某个函数
/// </summary>
public static class HybridCLROptimizer
{
public static void OptimizeHybridCLR()
{
OptimizeGenericType();
CallMethodInAssemblyExplicitly();
}
//显式访问频繁使用的泛型
private static void OptimizeGenericType()
{
}
//显式调用其他程序集防止裁剪(目前还未发现在不访问某程序集任何代码link.xml中有保留程序集被裁剪的情况)
private static void CallMethodInAssemblyExplicitly()
{
}
}
}