File tree Expand file tree Collapse file tree 5 files changed +33
-2
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 5 files changed +33
-2
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,14 @@ extension ContinuousClock: Clock {
139
139
#endif
140
140
}
141
141
142
+ @available ( SwiftStdlib 5 . 7 , * )
143
+ @_unavailableInEmbedded
144
+ extension ContinuousClock {
145
+ @available ( SwiftStdlib 5 . 7 , * )
146
+ @_alwaysEmitIntoClient
147
+ public var systemEpoch : Instant { unsafeBitCast ( Duration . seconds ( 0 ) , to: Instant . self) }
148
+ }
149
+
142
150
@available ( SwiftStdlib 5 . 7 , * )
143
151
@_unavailableInEmbedded
144
152
extension ContinuousClock . Instant : InstantProtocol {
Original file line number Diff line number Diff line change @@ -127,6 +127,14 @@ extension SuspendingClock: Clock {
127
127
#endif
128
128
}
129
129
130
+ @available ( SwiftStdlib 5 . 7 , * )
131
+ @_unavailableInEmbedded
132
+ extension SuspendingClock {
133
+ @available ( SwiftStdlib 5 . 7 , * )
134
+ @_alwaysEmitIntoClient
135
+ public var systemEpoch : Instant { unsafeBitCast ( Duration . seconds ( 0 ) , to: Instant . self) }
136
+ }
137
+
130
138
@available ( SwiftStdlib 5 . 7 , * )
131
139
@_unavailableInEmbedded
132
140
extension SuspendingClock . Instant : InstantProtocol {
Original file line number Diff line number Diff line change @@ -158,6 +158,13 @@ import StdlibUnittest
158
158
}
159
159
}
160
160
161
+ tests. test ( " Ensure abi layout size of Instant " ) {
162
+ // If this test fails it means the ABI of ContinuousClock.Instant has been broken!
163
+ // it MUST be the same laoyut of that of Duration
164
+ expectEqual ( MemoryLayout< ContinuousClock . Instant> . size, MemoryLayout< Duration> . size)
165
+ expectEqual ( MemoryLayout< SuspendingClock . Instant> . size, MemoryLayout< Duration> . size)
166
+ }
167
+
161
168
await runAllTestsAsync ( )
162
169
}
163
170
}
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ Added: _swift_task_dealloc_through
418
418
// SwiftSettings
419
419
Added: _$ss12SwiftSettingVsE16defaultIsolationyABScA_pXpSgFZ
420
420
421
+ // Clock systemEpochs
422
+ Added: _$ss15ContinuousClockV11systemEpochAB7InstantVvpMV
423
+ Added: _$ss15SuspendingClockV11systemEpochAB7InstantVvpMV
424
+
421
425
// Hashable for (Throwing)AsyncStream
422
426
Added: _$sScS12ContinuationV7storageScS8_StorageCyx_Gvg
423
427
Added: _$sScS12ContinuationV7storageScS8_StorageCyx_GvpMV
@@ -434,4 +438,4 @@ Added: _$sScs8_StorageCMn
434
438
Added: _$sScs8_StorageCMo
435
439
Added: _$sScs8_StorageCMu
436
440
Added: _$sScs8_StorageCfD
437
- Added: _$sScs8_StorageCfd
441
+ Added: _$sScs8_StorageCfd
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ Added: _swift_task_dealloc_through
418
418
// SwiftSettings
419
419
Added: _$ss12SwiftSettingVsE16defaultIsolationyABScA_pXpSgFZ
420
420
421
+ // Clock systemEpochs
422
+ Added: _$ss15ContinuousClockV11systemEpochAB7InstantVvpMV
423
+ Added: _$ss15SuspendingClockV11systemEpochAB7InstantVvpMV
424
+
421
425
// Hashable for (Throwing)AsyncStream
422
426
Added: _$sScS12ContinuationV7storageScS8_StorageCyx_Gvg
423
427
Added: _$sScS12ContinuationV7storageScS8_StorageCyx_GvpMV
@@ -434,4 +438,4 @@ Added: _$sScs8_StorageCMn
434
438
Added: _$sScs8_StorageCMo
435
439
Added: _$sScs8_StorageCMu
436
440
Added: _$sScs8_StorageCfD
437
- Added: _$sScs8_StorageCfd
441
+ Added: _$sScs8_StorageCfd
You can’t perform that action at this time.
0 commit comments