旧的泛型共享技术只能对class类型进行泛型共享。自2021.3.x LTS版本起,il2cpp已经支持完全泛型共享(full generic sharing)技术, 即泛型参数无论是任何类型(包含值类型)都可以共享。HybridCLR利用这个机制实现了不需要补充元数据,也可以完美支持AOT泛型。 设置 ...
基于full generic sharing完全泛型共享技术。该技术目前只在商业化版本提供。 提示 由于il2cpp泛型共享技术存在较大限制,强烈推荐使用补充元数据或者full generic sharing技术解决泛型问题。 il2cpp的泛型共享机制 il2cpp为了避免泛型代码膨胀,节约内存,在保证代码逻辑正确性的情况下对于一些能够共享代码,只生成一份代码...
uint8_t wrapper_type : 1; /* always zero (MONO_WRAPPER_NONE) needed for the debugger */ uint8_t has_full_generic_sharing_signature : 1; uint8_t indirect_call_via_invokers : 1; } MethodInfo; typedef struct Il2CppTypeDefinition { StringIndex nameIndex; StringIndex namespaceIndex; TypeI...
[fix] Fixes the bug where InterpreterInvoke in full generic sharing may have inconsistent methodPointer and virtualMethodPointer for class types, causing an error in incrementing the this pointer by 1. [fix] Fixes the bug where ldobj does not expand data into an int when T is a type like...
[fix] Fixes the bug where Il2CppGenericContextCompare only compares inst pointers, causing a large number of duplicate generic functions in the hot update module. [fix] Fixes the bug where MethodInfo is not correctly set when full generic sharing is enabled. Editor [new] Checks if the currentl...
full generic sharing完全泛型共享技术,相比补充元数据技术,工作流更简单,既不需要随包携带或者下载补充元数据dll,也不需要加载补充元数据dll,包体大小和内存都明显降低。该技术目前只在商业化版本提供。 对于方法1,有几个致命缺陷: AOT代码中添加实例化代码需要重新打包,不仅开发期很麻烦,上线后短期内重新发主包是不...
Whenfull generic sharingis enabled, each generic function (regardless of whether the generic parameter is a value type or a class type) will completely sharing a code. The advantage is to save the size of the package body, and the disadvantage is that it greatly hurts the performance of the...
[fix] Fixes the bug where Il2CppGenericContextCompare only compares inst pointers, causing a large number of duplicate generic functions in the hot update module. [fix] Fixes the bug where MethodInfo is not correctly set when full generic sharing is enabled. Editor [new] Checks if the currentl...
The WebGL platform uses thefaster (smaller) buildoption by default when packaging, which will enable full generic sharing, and the community version must add metadata before it can work with the full generic sharing mechanism. Solution: First try to add metadata and add the assembly where the ...