We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
每个类型的接口impl使用全局vtable变量
目前来说,我们的接口实现的vtable是存在本地接口变量中的,例如接口A有函数B和C,那么底层该接口如下:
{ gcrtti i64 real_ptr *i8 B i64(指针转的) C i64 }
实际上,我们希望他是这样的:
{ gcrtti i64 real_ptr *i8 _vtable *i8 }
_vtable指向一个全局变量,这个全局变量在每个结构体实现一个接口的时候会生成一个对应的:
impl A for D { fn B... fn C... } global impl_A_D { B i64 C i64 } 接口变量内存布局: { gcrtti i64 real_ptr *i8 _vtable *i8 -> impl_A_D }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
每个类型的接口impl使用全局vtable变量
目前来说,我们的接口实现的vtable是存在本地接口变量中的,例如接口A有函数B和C,那么底层该接口如下:
实际上,我们希望他是这样的:
_vtable指向一个全局变量,这个全局变量在每个结构体实现一个接口的时候会生成一个对应的:
The text was updated successfully, but these errors were encountered: