Install swiftmodules using the full module triple. This replaces the
CMake logic that attempts to compute the appropriate architecture using
values passed into CMake with a query to ask the compiler what the
appropriate module triple is for the given input target triple.
This is more robust mechanism and will future-proof this part of the
code against any new platforms and architectures to anything that the
Swift compiler building the project can support.
This is currently needed for the x86_64 FreeBSD bringup effort, where
the `amd64` architecture should be spelled `x86_64` in the swiftmodule
triple for the Swift compiler to find it. A surgical approach adding
another condition for amd64 FreeBSD would have less risk, but would also
require a new tag for every new platform that the `get_swift_host_arch`
didn't compute correctly or hadn't considered. The approach in the
commit will work for all new platforms. Bugs in this approach will come
from issues in the compiler when targeting the new platform and can be
fixed in the compiler without changes to Swift-Collections.
When ingesting a `String` instance, `BigString` assumes that the input string has a reasonably efficient UTF-8 view.
Unfortunately, that is very much not the case when the input happens to be backed by a bridged NSString object — it appears that in this case, the ingester loop invokes some operation(s) with linear complexity in the size of the entire input, rendering the ingester’s overall complexity quadratic.
The BigString ingester is only expected to operate within a single chunk at the time. It’s unclear precisely which operation triggers the quadratic behavior; ideally we should figure it out and resolve it with a more targeted fix.
In the meantime, a blunt stopgap fix is to force-transcode the input string to UTF-8 at the time the ingester is initialized. This unnecessarily wastes some (temporary) memory on holding the transcoded string, but it avoids the quadratic cliff.
Rope.join has a logic error where it fails to properly ensure uniqueness of child node references before zipping the two b-trees together.
rdar://128450202
We are forced to do this due to an Xcode issue (#364) with underscored module names.
This module remains unstable, despite the removal of the underscore. Directly importing it from outside the package remains unsupported. This module and/or its entire contents may go away or change in incompatible ways in any future swift-collections release.
A non-unique reference to a storage instance can legitimately become unique at any point, due to other references (say, held, by another thread) getting destroyed.
`Deque`’s `ensureUnique` implementation currently invokes the uniqueness check two times in quick succession, expecting it to return false both times. In rare circumstances, this can lead to a spurious trap in concurrent environments.
Fix this by avoiding calling `isUnique` more than once.
- Currently OrderedCollections cmake incorrectly list "Utilities/_UnsafeBitSet.swift" instead of "Utilities/_UnsafeBitset.swift", causing build failures
Our updated minimum toolchain requirement is Swift 5.7, and the stdlib in that version has the fix included.
We’ve seen reports that the bug may not deploy back in all cases to earlier OS releases, but it still seems worth trying to remove the workaround, as it has some undesirable runtime implications.
This prevents producing an empty string for the `description` of an empty bit set, and thus prevents us from having to include a diverging `debugDescription`.