Rename Memory wrapper from view to unsafe_vector
#54273
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #54156
Changes part of #53896
The main difference between
viewandunsafe_vectoris that the result ofviewhas a fixed size, and creates a copy when passed toString.The
String(view(pattern is fairly common: https://juliahub.com/ui/Search?q=String(view&type=code and as more packages start usingMemoryit may be hard to tell ifviewis being used safely or not.I'm not sure about the name
unsafe_vector, but the docstring saysSo I added an
unsafe_prefix.Ref #53552 (comment) for a discussion on why
viewon aMemoryshould produce anArray.