Commit Graph
1200 Commits
Author SHA1 Message Date
Karoy Lorentey 0e7c4655be [Future] RigidArray, DynamicArray: Add span properties 2024-08-19 19:44:14 -07:00
Karoy Lorentey 4d38958804 [Future] Add NewArray proof of concept 2024-08-19 19:44:14 -07:00
Karoy Lorentey 68a09aec17 [Future] Add Bovine 2024-08-19 19:44:14 -07:00
Karoy Lorentey af62dcd34f [Future] RandomAccessContainer: Reformulate default impls for Strideable indices 2024-08-19 19:44:13 -07:00
Karoy Lorentey e7a55c8759 [Future] Inout: follow the leading underscore rule 2024-08-19 19:44:13 -07:00
Karoy Lorentey c0802bd93f [Future] Add unsafelyOverrideLifetime(of:to:) 2024-08-19 19:44:12 -07:00
Karoy Lorentey 75aa5b0755 Hypo → Rigid, Dyno → Dynamic
Let’s try these on for size. The greek prefixes work great, but their capitalization looks bad, and they do not interact well with compound names. (`OrderedHyposet`?)
2024-08-12 13:35:42 -07:00
Karoy Lorentey 04bf0cff38 [_CollectionsUtilities] Unsafe[Mutable]BufferPointer: Add some initializeAll overloads 2024-08-07 19:13:12 -07:00
Karoy Lorentey 816fc78827 [_CollectionsUtilities] Add Unsafe[Mutable]BufferPointer._extracting(unchecked:)
Also, use these to spare some unnecessary instructions.
2024-08-07 19:12:05 -07:00
Karoy Lorentey dface3fb37 [Deque] Mitigate some effects of the lack of an empty Deque singleton 2024-08-07 19:10:29 -07:00
Karoy Lorentey 6322ec54a0 [Deque] Disable runtime exclusivity checking for the ivar of the storage class
It turns out the major slowdowns in individual element add/remove operations were mostly caused by runtime exclusivity checking on `Deque._Storage._value`.
2024-08-07 19:09:09 -07:00
Karoy Lorentey 9dcd20b473 [Xcode] Update xcodeproj 2024-08-07 19:05:31 -07:00
Karoy Lorentey 626e24fede [Deque] Add _UnsafeDequeHandle.reallocate(capacity:) 2024-08-06 20:00:27 -07:00
Karoy Lorentey 5d51572d69 [Deque] Stop using ManagedBuffer
Instead, just have a regular class holding a HypoDeque. This requires two allocations per deque, but it makes representation a lot more straightforward.

I do not have a workable solution for empty singletons, though.
2024-08-06 19:17:04 -07:00
Karoy Lorentey f64adedbf4 [Future] _CollectionsUtilities → InternalCollectionsUtilities 2024-08-06 11:33:20 -07:00
Karoy Lorentey a81352a313 [Future] BorrowingIterator: Make copyable; fix nextChunk’s lifetime constraint 2024-08-06 10:50:07 -07:00
Karoy Lorentey 7a34d55f64 [Xcode] Update project
- Bump to Xcode 16
- Update file lists
- Switch to Swift 6 language mode and enable a bunch of experimental features
2024-08-06 10:49:27 -07:00
Karoy Lorentey 944f4ab1fe [Deque] Delete old _UnsafeHandle type 2024-08-06 10:49:13 -07:00
Karoy Lorentey 3310a4c21c [Deque] Add HypoDeque and DynoDeque 2024-08-06 10:45:21 -07:00
Karoy Lorentey 774be11219 [Future] Add HypoArray and DynoArray 2024-08-06 10:44:12 -07:00
Karoy Lorentey 1a5b0e4981 [Future] Add very early prototype for borrowable containers
- protocol BorrowingIteratorProtocol
- protocol Container
- protocol BidirectionalContainer
- protocol RandomAccessContainer
2024-08-06 10:44:07 -07:00
Karoy Lorentey 6339b9859e [_CollectionsUtilities] Add new buffer pointer operations 2024-08-06 10:44:00 -07:00
Karoy Lorentey 0529df9aee [_CollectionsTestUtilities] Add U[M][R]BP._extracting(first:) and ._extracting(last:)
Also generalize some members to support ~Copyable elements
2024-08-06 10:43:53 -07:00
Karoy Lorentey 1401648016 [manifest] Adjust name of utilities module 2024-08-06 10:39:23 -07:00
Karoy Lorentey d58c5b60a5 Merge branch 'main' into future
# Conflicts:
#	Sources/CMakeLists.txt
#	Sources/InternalCollectionsUtilities/Compatibility/UnsafeMutableBufferPointer+SE-0370.swift.gyb
#	Sources/InternalCollectionsUtilities/Compatibility/UnsafeMutablePointer+SE-0370.swift.gyb
#	Sources/InternalCollectionsUtilities/Compatibility/UnsafeRawPointer extensions.swift.gyb
#	Sources/InternalCollectionsUtilities/Compatibility/autogenerated/UnsafeMutableBufferPointer+SE-0370.swift
#	Sources/InternalCollectionsUtilities/Compatibility/autogenerated/UnsafeMutablePointer+SE-0370.swift
#	Sources/InternalCollectionsUtilities/Compatibility/autogenerated/UnsafeRawPointer extensions.swift
#	Sources/InternalCollectionsUtilities/Specialize.swift.gyb
#	Sources/InternalCollectionsUtilities/autogenerated/Specialize.swift
2024-08-05 20:31:30 -07:00
Karoy Lorentey de6b22c32a Merge pull request #409 from lorentey/future-modernization
[Future] Adopt Swift 6; delete obsolete workarounds
2024-08-05 20:27:25 -07:00
Karoy Lorentey 5dd817c33d Merge branch 'release/1.1' 2024-08-05 20:10:26 -07:00
Karoy Lorentey e149704930 [RopeModule] Revert to Swift 5 mode 2024-08-05 20:04:38 -07:00
Karoy Lorentey a57ab2acec [manifest] Revert to Swift 5 for the test suite
TestContext is not anywhere near concurrency ready
2024-08-05 19:37:21 -07:00
Karoy Lorentey f14a18d7a6 Mark empty singletons as nonisolated(unsafe) 2024-08-05 19:37:20 -07:00
Yuta Saito 38602cff9f Merge pull request #408 from kateinoigakukun/yt/wasm-archs
[CMake] Add support for WebAssembly target architectures
2024-08-02 01:02:02 +09:00
Yuta Saito effb33569a [CMake] Add support for WebAssembly target architectures
To repair the swift-corelibs-foundation build on WebAssembly, we need to
add support for Wasm targets to swift-collections' CMake build system.
2024-08-01 00:30:34 +00:00
Karoy Lorentey 2359d9a09c [_CollectionsUtilities] Fix visibility modifiers in single module mode 2024-07-31 16:20:18 -07:00
Karoy Lorentey c1dd7622c4 [manifest] Bump to v6.0 toolchain and language mode
- Enable SuppressedAssociatedTypes to allow experimentation with protocols
- Mark _CollectionsTestSupport as a test dependency on FutureTests
2024-07-31 16:20:16 -07:00
Karoy Lorentey 0d4376d5cd [_CollectionsUtilities] Delete obsolete compatibility definitions 2024-07-29 13:18:25 -07:00
Guillaume Lessard 3847f3ac53 add a description property 2024-07-24 17:04:37 -07:00
Guillaume Lessard 80c67c2eff add identity operator 2024-07-24 17:04:37 -07:00
Karoy Lorentey 293314a584 Merge pull request #403 from quokkaKyu/release/1.1
add 'final' keyword to class
2024-07-18 14:38:35 -07:00
Guillaume Lessard e5a2570b79 Merge pull request #406 from glessard/just-span
Round out Span initializers
2024-07-16 15:11:10 -07:00
Guillaume Lessard 93efdb9e4e add doc-comments for the containment utilities 2024-07-16 13:30:51 -07:00
Guillaume Lessard 296f94c2d8 remove undesirable default values 2024-07-16 13:30:29 -07:00
Guillaume Lessard c611501b0a mark _indices and _byteOffsets as @_aEIC 2024-07-16 09:09:44 -07:00
Guillaume Lessard fe649d9a4c add convenience initializers for Span 2024-07-16 08:56:22 -07:00
Guillaume Lessard c0d0230905 add convenience initializers for RawSpan 2024-07-16 08:55:15 -07:00
Karoy Lorentey 2db08b3d06 Merge pull request #405 from apple/accidentally-quadratic-BigString-init
[BigString] Fix accidentally quadratic `BigString.init`
2024-07-15 15:33:11 -07:00
Guillaume Lessard 8bb827b2c5 Merge pull request #404 from glessard/just-span
Improve internal representation of `Span`
2024-07-15 14:04:31 -07:00
Karoy Lorentey 5e1fe6e8f0 [BigString] Fix accidentally quadratic BigString.init
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.
2024-07-15 13:13:44 -07:00
quokkakyu 6b8276e252 add 'final' keyword to class 2024-07-15 09:27:27 +09:00
Guillaume Lessard 6f4d9d8560 improve internal representation of RawSpan 2024-07-14 04:31:13 -07:00
Guillaume Lessard b7aab16cce improve internal representation of Span 2024-07-14 04:22:33 -07:00