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

LuaState::propLinks有什么用? #534

Open
gunsungithub opened this issue Jul 1, 2023 · 3 comments
Open

LuaState::propLinks有什么用? #534

gunsungithub opened this issue Jul 1, 2023 · 3 comments

Comments

@gunsungithub
Copy link

群加不了,只能在这问了。

  1. 我没有看出LuaState::propLinks有什么作用,是为将来的功能准备的吗?
  2. pushGCObject里面有addLink,对于UClass,好像没有对应的releaseLink
@zjhongxian
Copy link
Collaborator

它是维护Struct类型有效性用的,比如:一个UObject有个Struct成员,Struct里面又有多重嵌套,那么当UObject GC之后,对应的Struct就需要标记为失效了。

关联机制:Struct由原来的每次访问都Copy改为Reference

@gunsungithub
Copy link
Author

我在2.0.2版本上没有看到LuaObject::gcObjectLuaObject::gcClass里面对结构体进行处理,也没有对LuaState::proLinks进行处理。
我是不是漏掉了什么?

@zjhongxian
Copy link
Collaborator

LuaState::NotifyUObjectDeleted里面有releaseLink的处理,另gcStruct也有对应处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants