Skip to content

[4.0] KeyPaths: Pointer-align pointer fields within key path patterns. #10420

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

Conversation

jckarter
Copy link
Contributor

@jckarter jckarter commented Jun 20, 2017

Explanation: To get the full benefit of dyld3 on Darwin platforms, pointer relocations need to be pointer-aligned. The key path implementation originally packed pointers in order to save memory.

Scope: Any code using literal key path objects would raise "pointer not aligned" linker warnings in Xcode 9.

Issue: rdar://problem/32318829

Risk: Low, incremental change to new feature whose potential fallout should be isolated to key paths.

Testing: Swift CI

To get the full benefit of dyld3 on Darwin platforms, pointer relocations need to be pointer-aligned, which unfortunately requires growing some key path data structures a little bit. This does tidy up some code that had to hack around our lack of unaligned load/store operations on UnsafeRawPointer, at least. While we're here, we can also simplify the identification strategy for reabstracted stored properties; we only need the property index to identify, not the absolute offset. rdar://problem/32318829
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter
Copy link
Contributor Author

@slavapestov Mind looking over this for 4.0?

@jckarter jckarter requested a review from slavapestov June 20, 2017 21:46
Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

LGTM

@slavapestov
Copy link
Contributor

LGTM

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