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 {
139139#endif
140140}
141141
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+
142150@available ( SwiftStdlib 5 . 7 , * )
143151@_unavailableInEmbedded
144152extension ContinuousClock . Instant : InstantProtocol {
Original file line number Diff line number Diff line change @@ -127,6 +127,14 @@ extension SuspendingClock: Clock {
127127#endif
128128}
129129
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+
130138@available ( SwiftStdlib 5 . 7 , * )
131139@_unavailableInEmbedded
132140extension SuspendingClock . Instant : InstantProtocol {
Original file line number Diff line number Diff line change @@ -158,6 +158,13 @@ import StdlibUnittest
158158 }
159159 }
160160
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+
161168 await runAllTestsAsync ( )
162169 }
163170}
Original file line number Diff line number Diff line change @@ -418,6 +418,10 @@ Added: _swift_task_dealloc_through
418418// SwiftSettings
419419Added: _$ss12SwiftSettingVsE16defaultIsolationyABScA_pXpSgFZ
420420
421+ // Clock systemEpochs
422+ Added: _$ss15ContinuousClockV11systemEpochAB7InstantVvpMV
423+ Added: _$ss15SuspendingClockV11systemEpochAB7InstantVvpMV
424+
421425// Hashable for (Throwing)AsyncStream
422426Added: _$sScS12ContinuationV7storageScS8_StorageCyx_Gvg
423427Added: _$sScS12ContinuationV7storageScS8_StorageCyx_GvpMV
@@ -434,4 +438,4 @@ Added: _$sScs8_StorageCMn
434438Added: _$sScs8_StorageCMo
435439Added: _$sScs8_StorageCMu
436440Added: _$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
418418// SwiftSettings
419419Added: _$ss12SwiftSettingVsE16defaultIsolationyABScA_pXpSgFZ
420420
421+ // Clock systemEpochs
422+ Added: _$ss15ContinuousClockV11systemEpochAB7InstantVvpMV
423+ Added: _$ss15SuspendingClockV11systemEpochAB7InstantVvpMV
424+
421425// Hashable for (Throwing)AsyncStream
422426Added: _$sScS12ContinuationV7storageScS8_StorageCyx_Gvg
423427Added: _$sScS12ContinuationV7storageScS8_StorageCyx_GvpMV
@@ -434,4 +438,4 @@ Added: _$sScs8_StorageCMn
434438Added: _$sScs8_StorageCMo
435439Added: _$sScs8_StorageCMu
436440Added: _$sScs8_StorageCfD
437- Added: _$sScs8_StorageCfd
441+ Added: _$sScs8_StorageCfd
You can’t perform that action at this time.
0 commit comments