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

Avoid using generic static members on Duration across module boundaries #73419

Merged

Conversation

stephentyrone
Copy link
Member

Because the clocks are implemented in Concurrency, but Duration is in the Swift module, these don't get specialized. Add a fully-concrete internal init in Concurrency to avoid the problem.

Because the clocks are implemented in Concurrency, but Duration is in the Swift module, these don't get specialized. Add a fully-concrete internal init in Concurrency to avoid the problem.
Copy link
Member

@phausler phausler left a comment

Choose a reason for hiding this comment

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

lgtm

@stephentyrone
Copy link
Member Author

@swift-ci test

@stephentyrone
Copy link
Member Author

@swift-ci test

@stephentyrone stephentyrone merged commit da9922d into apple:main May 4, 2024
5 checks passed
@stephentyrone stephentyrone deleted the duration-initializers-without-generics branch May 4, 2024 14:40
gottesmm pushed a commit to gottesmm/swift that referenced this pull request May 6, 2024
…es (apple#73419)

* Avoid using generic static members on Duration across module boundaries

Because the clocks are implemented in Concurrency, but Duration is in the Swift module, these don't get specialized. Add a fully-concrete internal init in Concurrency to avoid the problem.

* Call self.init(_high:low:) explicitly.

* Add availability annotation.

(cherry picked from commit da9922d)
stephentyrone added a commit that referenced this pull request May 11, 2024
* Make static [milli/micro/nano]seconds members on Duration inlinable (#73429)

This means that they can't use _Int128 for their implementation, but efficient implementation of these using only 64b arithmetic is pretty straightforward, so that's OK. This allows them to be specialized and mostly optimized away in release builds.

* Avoid using generic static members on Duration across module boundaries (#73419)

* Avoid using generic static members on Duration across module boundaries

Because the clocks are implemented in Concurrency, but Duration is in the Swift module, these don't get specialized. Add a fully-concrete internal init in Concurrency to avoid the problem.

* Call self.init(_high:low:) explicitly.

* Add availability annotation.
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.

None yet

3 participants