Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

优化使用引用计数器数据的ffi传输 #11

Open
LaoLittle opened this issue Dec 16, 2022 · 2 comments
Open

优化使用引用计数器数据的ffi传输 #11

LaoLittle opened this issue Dec 16, 2022 · 2 comments

Comments

@LaoLittle
Copy link
Owner

LaoLittle commented Dec 16, 2022

AtriBot内有很多Arc wrapper, 比如Client, Group, Friend...

他们的数据转移到插件的时候会先转换为Managed结构体
该转换包含了一次堆分配, 而Arc本身就是将数据存入堆中的(也就是变成了Box<Arc>)

考虑添加ManagedArc, 使用Arc::into_rawArc::from_raw, 减少堆分配(释放)

@LaoLittle
Copy link
Owner Author

Arc就是一个pointer wrapper,可以直接transmute

@LaoLittle
Copy link
Owner Author

08bd35

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

No branches or pull requests

1 participant