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

Box<dyn _> #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

mio-19
Copy link
Contributor

@mio-19 mio-19 commented Apr 4, 2020

fix #8

@quark-zju
Copy link
Owner

quark-zju commented Apr 4, 2020

This removes an optimization. The old code will not track types like Box<T> where T is known to be untracked. That means Cc<Box<T>> won't be inserted to the linked list and Cc<Box<T>> takes less space in memory.

Could you use the customize type instead? That is, define struct MyBox(Box<dyn MyTrait>) and implement Trace on MyBox. That would preserve the optimization and makes Cc<MyBox> compile.

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

Successfully merging this pull request may close these issues.

Box<dyn T>
2 participants