Uploaded image for project: 'Swift'
  1. Swift
  2. SR-1962

Consider simplifying the isUniquelyReferenced() family and eliminating NonObjectiveCBase

    XMLWordPrintable

    Details

      Description

      Because of the low-level nature of the isUniquelyReferenced operation, one possible design is to eliminate NonObjectiveCBase, and instead just have the isUniquelyReferencedUnsafe operation, that would check the contract in debug mode, but would be fast in release mode.

      For most use cases, developers should be able to use the ManagedBufferPointer type, so it is probably acceptable to choose the smaller API surface in the tradeoff between having only isUniquelyReferencedUnsafe for custom classes and complicating the standard library API with a special superclass type.

      This would leave us with two functions:

      • isUniquelyReferencedUnsafe()
      • isUniquelyReferencedNonObjC()

        Attachments

          Activity

            People

            Assignee:
            aschwaighofer Arnold Schwaighofer
            Reporter:
            gribozavr Dmitri Gribenko
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: