Skip to content

CoreFoundation: clean up module locator logic #3163

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
Apr 1, 2022

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Apr 1, 2022

Use the address of the function to get a module handle without bumping
the refcount of the module. This avoids the need to hardcode the
library name and enables the use of CoreFoundation in a statically
linked fashion as well. We can further reduce the logic by using the
PathCch routine to remove the trailing file specification. This reduces
the complexity in the module location code and reuses the system
libraries for a small additional cost of an additional iteration of the
string path.

Use the address of the function to get a module handle without bumping
the refcount of the module.  This avoids the need to hardcode the
library name and enables the use of CoreFoundation in a statically
linked fashion as well.  We can further reduce the logic by using the
PathCch routine to remove the trailing file specification.  This reduces
the complexity in the module location code and reuses the system
libraries for a small additional cost of an additional iteration of the
string path.
@millenomi
Copy link
Contributor

@swift-ci please test

@millenomi millenomi merged commit 365bb75 into swiftlang:main Apr 1, 2022
@compnerd compnerd deleted the path branch April 2, 2022 01:24
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.

2 participants