Skip to content

Conversation

@jckarter
Copy link
Contributor

Explanation: For types like Atomic and Mutex, we want to know that even though they are technically bitwise-takable, they differ from other bitwise-takable types until this point because they are not also "bitwise-borrowable"; while borrowed, they are pinned in memory, so they cannot be passed by value as a borrowed parameter, unlike copyable bitwise-takable types. Add a bit to the value witness table flags to record this.
Scope: Backward-compatible ABI change for types like Atomic and Mutex.
Issue: rdar://136396806
Original PR: #76688
Risk: Low. Introduces a new value witness flags bit that is ignored by current and previously-released Swift runtimes.
Testing: Swift CI
Reviewer: @atrick

…awLayout` types.

For types like `Atomic` and `Mutex`, we want to know that even though they are
technically bitwise-takable, they differ from other bitwise-takable types until
this point because they are not also "bitwise-borrowable"; while borrowed,
they are pinned in memory, so they cannot be passed by value as a borrowed
parameter, unlike copyable bitwise-takable types. Add a bit to the value witness
table flags to record this.

Note that this patch does not include any accompanying runtime support for
propagating the flag into runtime-instantiated type metadata. There isn't yet
any runtime functionality that varies based on this flag, so that can
be implemented separately.

rdar://136396806
@jckarter jckarter requested a review from a team as a code owner September 25, 2024 18:16
@jckarter
Copy link
Contributor Author

@swift-ci Please test

@jckarter jckarter merged commit 7c8cd13 into swiftlang:release/6.0 Sep 25, 2024
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