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

Implement Zip::apply_collect for non-Copy elements too #814

Merged
merged 3 commits into from
Apr 29, 2020

Conversation

bluss
Copy link
Member

@bluss bluss commented Apr 29, 2020

Implement a partial array wrapper, that keeps track of written elements, so
that we can drop the ones written, if unwinding happens before the whole
operation is done.

The written elements are recorded by their count, and in which memory order
they were written.

The parallel case does not yet have this update, since it will require handling
splitting and multiple simultaneous "write heads". Rayon's model, if it can be used,
is amenable to tracking this correctly for 1D-indexed parallel iterators, so it might
be possible to resolve that way.

Test both String (with drop) and f64 (Copy type), compare Array to
Vec::from_iter.
@bluss bluss merged commit adef586 into master Apr 29, 2020
@bluss bluss deleted the zip-collect-drop branch April 29, 2020 15:14
@bluss bluss mentioned this pull request Oct 9, 2020
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.

1 participant