Skip to content

[stdlib] ABI audit for _BridgeStorage #20159

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 3 commits into from
Oct 31, 2018

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Oct 30, 2018

  • Make _BridgeStorage internal (but @inlinable)
  • Limit spareBits interface to the highest common platform denominator: a single boolean value.
  • Rename members:
    init(native:,bits:) ⟹ init(native:,isFlagged:)
    func isNativeWithClearedSpareBits() ⟹ isUnflaggedNative
    var nativeInstance_noSpareBits ⟹ unflaggedNativeInstance
    func isUniquelyReferenced_native_noSpareBits() ⟹ isUniquelyReferencedUnflaggedNative()

@lorentey
Copy link
Member Author

@swift-ci test

@jrose-apple
Copy link
Contributor

jrose-apple commented Oct 30, 2018

Limit spareBits interface to the lowest common platform denominator: a single boolean value.

I thought String was already relying on BridgeObject having more spare bits than that. Am I mistaken? Ah, right, this includes 32-bit platforms.

@lorentey
Copy link
Member Author

Limit spareBits interface to the lowest common platform denominator: a single boolean value.

I thought String was already relying on BridgeObject having more spare bits than that.

String can only do that on 64-bit platforms, where there are plenty of unused bits. On 32-bit we have a different, less compact representation that uses an enum instead of BridgeObject.

- Make internal (but @inlinable)
- Limit API to what is actually supported: a single boolean value.
- Rename members:

    init(native:,bits:) ⟹ init(native:,isFlagged:)
    func isNativeWithClearedSpareBits() ⟹ isUnflaggedNative
    var nativeInstance_noSpareBits ⟹ unflaggedNativeInstance
    func isUniquelyReferenced_native_noSpareBits() ⟹ isUniquelyReferencedUnflaggedNative()
@lorentey lorentey force-pushed the bridgestorage-audit branch from 4bd8b99 to 6593817 Compare October 31, 2018 13:18
@lorentey
Copy link
Member Author

@swift-ci please smoke test

@lorentey lorentey merged commit 2aa5b49 into swiftlang:master Oct 31, 2018
@lorentey lorentey deleted the bridgestorage-audit branch October 31, 2018 15:13
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