146 Commits
Author SHA1 Message Date
Karoy Lorentey 6c89474e62 Merge pull request #84 from lorentey/finalize-1.1
Update README
1.1.0
2023-04-01 15:38:59 -07:00
Karoy Lorentey c95665ddba Update README 2023-04-01 15:35:38 -07:00
Karoy Lorentey 2a2be812fa Merge pull request #83 from lorentey/finalize-1.1
Utilities/run-full-tests.sh: Use a different derived data path when building the Xcode project
2023-03-31 15:51:43 -07:00
Karoy Lorentey 8faf7003f8 Utilities/run-full-tests.sh: Use a different derived data path when building the Xcode project 2023-03-31 15:50:08 -07:00
Karoy Lorentey 6287624002 Merge pull request #82 from lorentey/finalize-1.1
1.1 release preparations
2023-03-31 15:26:12 -07:00
Karoy Lorentey 581634cdaf Update Xcode project 2023-03-31 15:19:44 -07:00
Karoy Lorentey 5aad046da6 Update CMake test configuration 2023-03-31 15:19:33 -07:00
Karoy Lorentey bbee754adc ManagedAtomic[LazyReference]: Always access ivar through pointer
The deinit implementations used to access the ivar directly, but that can confuse the compiler into assuming the value never changes after its initialization, because it doesn’t see accesses that are done via the pointer.

Stop accessing the ivar directly once it has been initialized.
2023-03-31 15:19:02 -07:00
Karoy Lorentey 951d3b2df4 Merge pull request #81 from lorentey/more-5.6-fixes
Fix some edge cases under 5.6
2023-03-31 13:42:18 -07:00
Karoy Lorentey b1ecf114a5 Utilities/run-full-tests.sh: Test building the Xcode project 2023-03-31 13:14:42 -07:00
Karoy Lorentey 378fb4947f Also fix compatibility with 5.6 when ATOMICS_NATIVE_BUILTINS is enabled 2023-03-31 13:14:42 -07:00
Karoy Lorentey 6fbaf34baf Merge pull request #80 from lorentey/update-file-headers
Update file headers
2023-03-30 16:03:40 -07:00
Karoy Lorentey e53eff6f17 Update file headers 2023-03-30 14:58:57 -07:00
Karoy Lorentey b42b691f84 Merge pull request #78 from lorentey/fix-5.6-compatibility
Fix compatibility with Swift 5.6
2023-03-30 14:28:11 -07:00
Karoy Lorentey 58a95f7984 Fix compatibility with Swift 5.6 2023-03-30 14:05:45 -07:00
Karoy Lorentey e4ef9e7764 Merge pull request #77 from lorentey/add-xcode-test-project
Add an Xcode project exercising native builtins in a monomodule configuration
2023-03-24 21:18:22 -07:00
Karoy Lorentey 5a9973dc1d Add an Xcode project exercising native builtins in a monomodule configuration
This is going to ship as is, with no promises about it remaining in future versions. It is going to be a load bearing component of the package, though — just not necessary a stable one.
2023-03-24 20:34:16 -07:00
Karoy Lorentey 4ff09f2cf3 Merge pull request #76 from lorentey/weakCompareExchange-shortcut
Add a weakCompareExchange variant that only takes a single ordering
2023-03-24 17:12:48 -07:00
Karoy Lorentey 11a0547baa Update CMake configuration 2023-03-24 17:12:13 -07:00
Karoy Lorentey 0f07d9dcf8 Add a weakCompareExchange variant that only takes a single ordering
Resolves https://github.com/apple/swift-atomics/issues/75
2023-03-24 16:30:49 -07:00
Karoy Lorentey ce1f045d7d Merge pull request #74 from lorentey/native-builtins
Add support for using LLVM intrinsics instead of C atomics
2023-03-24 15:38:53 -07:00
Karoy Lorentey 7feb1c1791 Add support for using LLVM intrinsics instead of C atomics 2023-03-24 15:33:30 -07:00
Karoy Lorentey ca8a8fcc38 Merge pull request #58 from lorentey/fix-non-final-class-warnings
Fix support for non-final classes in AtomicReference
2023-03-20 16:41:41 -07:00
Karoy Lorentey 81f9344ded Merge pull request #73 from lorentey/update-optional-rawrepresentables
Update AtomicOptionalWrappable support for RawRepresentable types
2023-03-20 12:22:49 -07:00
Karoy Lorentey 79718d92d3 Prepare for the protocol refactoring in #58 2023-03-19 20:42:55 -07:00
Karoy Lorentey 07ceb40fe1 AtomicOptionalRawRepresentableStorage.Storage → _Storage 2023-03-19 20:42:33 -07:00
Karoy Lorentey 907ce2a79e Remove remaining references to _AtomicValue 2023-03-19 20:41:37 -07:00
Karoy Lorentey e876381f7d Red tape for our lovely build systems 2023-03-19 20:15:06 -07:00
Karoy Lorentey f482c3098d Update AtomicOptionalWrappable support for RawRepresentable types
Also add some basic tests exercising these.
2023-03-19 19:59:46 -07:00
Karoy Lorentey 9ba5ea5898 Merge pull request #72 from lorentey/fix-weakCompareExchange-coverage
[test] Fix basic tests to to actually cover weakCompareExchange
2023-03-19 19:56:15 -07:00
Karoy Lorentey 46e4e960ac [test] Fix basic tests to to actually cover weakCompareExchange 2023-03-19 19:50:52 -07:00
Karoy Lorentey 9088deb8db Merge pull request #42 from glessard/optional-rawrepresentable-atomic
implement AtomicStorage for Optionals of RawRepresentable types
2023-03-19 19:33:26 -07:00
Karoy Lorentey 3d0a97769f [nfc] Reflow 2023-03-19 19:27:10 -07:00
Karoy Lorentey 57e4436c03 Merge pull request #70 from lorentey/simplify-shims
Simplify shims
2023-03-19 19:18:17 -07:00
Karoy Lorentey 0f2c36bf75 _AtomicsShims: Also delete encoder/decoder macro for bools 2023-03-18 13:13:56 -07:00
Karoy Lorentey f2c34f56f6 Simplify shims
Now that we can rely on https://reviews.llvm.org/D86218, we don’t need to tiptoe around the use of `_Atomic(struct dword)`.

Rip out the clumsy encode/decode mess and the use of __uint128_t.
2023-03-18 13:10:31 -07:00
Karoy Lorentey 40569d69e2 Merge pull request #71 from lorentey/tie-test-registration-to-cmake
Resolve some test issues
2023-03-18 13:02:02 -07:00
Karoy Lorentey 8ca2dee2bf Split Basics.swift.gyb up into 26 different files
The original autogenerated swift file is so humongous that it causes problems for some folks.

Split it up into one file per XCTestCase.
2023-03-18 01:27:16 -07:00
Karoy Lorentey 45772d95ff Disable test registration outside of CMake builds 2023-03-18 00:49:15 -07:00
Karoy Lorentey 5730529b7f Replace AtomicValue._AtomicValue with AtomicReference._AtomicBase 2023-03-17 22:08:36 -07:00
Karoy Lorentey cc86c556be Fix support for non-final classes in AtomicReference
Swift 5.6/7 generates new compiler warnings when non-final classes
conform to `AtomicReference`. The warnings are pointing out a real
design issue: Self is covariant in protocols, but we intend atomic
operations to always deal with the base class rather than individual
subclasses.

Add a new associated type requirement to AtomicValue to represent the
actual type that originally conformed to the protocol, and add
explicit same-type requirements to clients to ensure they aren’t
asked to return a subclass.

Unfortunately, this change is source breaking:

```
class Base: AtomicReference {}
class Derived: Base {}

let ref = ManagedAtomic<Derived?>(nil)
  // before: OK
  // after: 'ManagedAtomic' requires the types 'Derived' and 'Base' be equivalent
```
2023-03-17 16:24:51 -07:00
Karoy Lorentey 6fcf644523 Merge pull request #69 from lorentey/fix-leak
ManagedAtomicLazyReference: Properly dispose object on deinit
2023-03-17 15:34:56 -07:00
Karoy Lorentey cb7a3b2d35 ManagedAtomicLazyReference: Properly dispose object on deinit 2023-03-17 15:11:58 -07:00
Karoy Lorentey 71a1f8695c Merge pull request #68 from lorentey/remove-obsolete-workarounds
Remove obsolete workarounds for older toolchains
2023-03-17 15:09:09 -07:00
Karoy Lorentey 275fb6be61 Remove obsolete workarounds for older toolchains 2023-03-17 14:47:54 -07:00
Karoy Lorentey a79166d648 Merge pull request #46 from lorentey/sendable
Mark managed atomic constructs Sendable if their payloads are
2023-03-17 14:41:13 -07:00
Karoy Lorentey e6bb2b4402 Merge pull request #67 from lorentey/bump-toolchain-to-5.6
Bump minimum required toolchain to Swift 5.6
2023-03-17 14:37:37 -07:00
Karoy Lorentey 0bcc0c5b54 Merge pull request #65 from kelvin13/main
enable AtomicReference everywhere
2023-03-17 14:20:11 -07:00
Karoy Lorentey 3a39dbae0c Update README 2023-03-17 14:19:10 -07:00
Karoy Lorentey b82b616254 Bump minimum required toolchain to Swift 5.6. 2023-03-17 14:13:29 -07:00