Skip to content

Box<dyn _>#9

Open
mio-19 wants to merge 1 commit into
quark-zju:masterfrom
archive-tsao-chi-forks:patch-1
Open

Box<dyn _>#9
mio-19 wants to merge 1 commit into
quark-zju:masterfrom
archive-tsao-chi-forks:patch-1

Conversation

@mio-19

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

Copy link
Copy Markdown
Contributor

fix #8

@quark-zju

quark-zju commented Apr 4, 2020

Copy link
Copy Markdown
Owner

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