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

Guarantee that .as_slice_memory_order_mut() preserves strides #1019

Merged

Conversation

jturner314
Copy link
Member

Fixes #1018.

This fixes bugs in `.map_mut()` and `.zip_mut_with_same_shape()`.
Before this commit, strides obtained before calling
`.as_slice_memory_order_mut()` could not be used to correctly
interpret the data in the returned slice. Now, the strides are
preserved, so the implementations of `.map_mut()` and
`.zip_mut_with_same_shape()` work correctly. This also makes it much
easier for users of the crate to use `.as_slice_memory_order_mut()`
correctly in generic code.

Fixes rust-ndarray#1018.
Copy link
Member

@bluss bluss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for working on this.

@bluss bluss added this to the 0.15.3 milestone Jun 1, 2021
@bluss bluss merged commit 81662ae into rust-ndarray:master Jun 5, 2021
@jturner314 jturner314 deleted the improve-as_slice_memory_order_mut branch June 5, 2021 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants