Skip to content

[stdlib] Fixing a buggy example in the comments in the file UnsafeRawPointer.swift #22066

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

Merged
merged 1 commit into from
Jan 24, 2019

Conversation

ravikandhadai
Copy link
Contributor

No description provided.

@jrose-apple
Copy link
Contributor

I thought the point of these APIs was that they do unaligned loads and stores.

@ravikandhadai
Copy link
Contributor Author

Actually, in the current form they do require alignment, as was clarified by @atrick. In fact, storeBytes has a precondition that checks the alignment and so does load. I am actually interested in an unaligned version and came across this bug.

@atrick
Copy link
Contributor

atrick commented Jan 24, 2019

The underlying primitive assumes alignment. We should definitely have unaligned variants, or add an unaligned flag as an argument, but no one has gotten around to written the Swift evolution proposal.

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

LGTM

@ravikandhadai
Copy link
Contributor Author

@swift-ci please test and merge

@swift-ci swift-ci merged commit 92416e7 into swiftlang:master Jan 24, 2019
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.

4 participants