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

Unnecessary indirection for 'unsafe' boxed vecs in layout #7986

Open
frewsxcv opened this issue Oct 12, 2015 · 4 comments
Open

Unnecessary indirection for 'unsafe' boxed vecs in layout #7986

frewsxcv opened this issue Oct 12, 2015 · 4 comments
Labels

Comments

@frewsxcv
Copy link
Member

@frewsxcv frewsxcv commented Oct 12, 2015

pub type UnsafeLayoutNodeList = (Box<Vec<UnsafeLayoutNode>>, usize);
pub type UnsafeFlowList = (Box<Vec<UnsafeLayoutNode>>, usize);

Vec is already on the heap, is Box necessary?

@mbrubeck
Copy link
Contributor

@mbrubeck mbrubeck commented Oct 12, 2015

run_queue_with_custom_work_data_type uses transmute to convert between this type and struct WorkQueueData(usize, usize). So it needs to be exactly two pointers wide. Maybe we could use Box<[T]> instead of (Box<Vec<T>>, usize). (The usize element is unused.)

@Manishearth
Copy link
Member

@Manishearth Manishearth commented Oct 12, 2015

Are we pushing to the vector? If not, Box<[T]> makes more sense.

@eefriedman
Copy link
Contributor

@eefriedman eefriedman commented Oct 12, 2015

If #7524 ever lands, the relevant code will become a lot simpler.

@Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Oct 13, 2015

Box<[T]> should work; I'm pretty sure I've written that code at some point. Can't find that branch now, though.

@frewsxcv frewsxcv added the I-refactor label Oct 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.