Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
labbbirder committed Apr 1, 2024
1 parent baf1a41 commit b829166
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,9 @@ UnityInjection在编译时织入,不用担心运行时兼容性

3. **支持泛型**

> 泛型的支持有一些特殊性。这种特殊性表现在,不同的GenericInstance有时共享同一个方法体,有时又独享之。
如:Full Generic Sharing方法存在一个共享的方法体;普通Generic Sharing则按照泛型类型内存大小共享方法体
>
> 为实现泛型方法的注入。UnityInjection需要实现一种GenericInstantiation(classInst&methodInst)遍历的技术。
这种技术对于IL2CPP backend来说,可以轻易实现;但是对于Mono backend,作者尚需更深入的文献、源码研究和测试才能给出可靠的方法。
泛型的支持有一些特殊性,这种特殊性需要额外的工作:
||Inject Phase|Fix Phase|
|:-|:-|:-|
|AOT approach|与非泛型方法相同|-|
|RT approach|不同的GenericInstance有时共享同一个方法体,有时又独享之。如:Full Generic Sharing方法存在一个共享的方法体;普通Generic Sharing则按照泛型类型内存大小共享方法体|泛型实例是运行时创建的。UnityInjection需要实现一种GenericInstantiation(classInst&methodInst)遍历的技术。这种技术对于IL2CPP backend来说,可以轻易实现;但是对于Mono backend,则需要对cctor的额外注入。|

0 comments on commit b829166

Please sign in to comment.