|
32 | 32 | #endif |
33 | 33 |
|
34 | 34 | #include <inttypes.h> |
35 | | -#include <stdalign.h> |
36 | 35 | #include <stdbool.h> |
37 | 36 | #include <stdlib.h> |
38 | 37 |
|
@@ -92,11 +91,11 @@ static inline int swift_priority_getBucketIndex(SwiftJobPriority priority) { |
92 | 91 |
|
93 | 92 | /// Used by the Concurrency runtime to represent a job. The `schedulerPrivate` |
94 | 93 | /// field may be freely used by the executor implementation. |
95 | | -typedef struct alignas(2 * alignof(void *)) { |
| 94 | +typedef struct { |
96 | 95 | SwiftHeapMetadata const *__ptrauth_objc_isa_pointer metadata; |
97 | 96 | void *schedulerPrivate[2]; |
98 | 97 | SwiftJobFlags flags; |
99 | | -} SwiftJob; |
| 98 | +} __attribute__((aligned(2 * sizeof(void *)))) SwiftJob; |
100 | 99 |
|
101 | 100 | /// Indexes in the schedulerPrivate array |
102 | 101 | enum { |
@@ -173,7 +172,7 @@ swift_executor_complexEquality(SwiftHeapObject *identity, |
173 | 172 | /// Get the type of executor (ordinary vs complex equality). |
174 | 173 | static inline SwiftExecutorKind |
175 | 174 | swift_executor_getKind(SwiftExecutorRef executor) { |
176 | | - const uintptr_t mask = ~uintptr_t(alignof(void *) - 1); |
| 175 | + const uintptr_t mask = ~(uintptr_t)(sizeof(void *) - 1); |
177 | 176 | return executor.implementation & ~mask; |
178 | 177 | } |
179 | 178 |
|
@@ -202,7 +201,7 @@ static inline bool swift_executor_hasWitnessTable(SwiftExecutorRef executor) { |
202 | 201 | /// Retrieve the witness table of an executor. |
203 | 202 | static inline const SwiftExecutorWitnessTable * |
204 | 203 | swift_executor_getWitnessTable(SwiftExecutorRef executor) { |
205 | | - const uintptr_t mask = ~uintptr_t(alignof(void *) - 1); |
| 204 | + const uintptr_t mask = ~(uintptr_t)(sizeof(void *) - 1); |
206 | 205 | return (const SwiftExecutorWitnessTable *)(executor.implementation & mask); |
207 | 206 | } |
208 | 207 |
|
@@ -277,15 +276,15 @@ SWIFT_CC(swift) void swift_task_enqueueMainExecutorImpl(SwiftJob *job); |
277 | 276 | SWIFT_CC(swift) void swift_task_checkIsolatedImpl(SwiftExecutorRef executor); |
278 | 277 |
|
279 | 278 | /// Get a reference to the main executor. |
280 | | -SWIFT_CC(swift) SwiftExecutorRef swift_task_getMainExecutorImpl(); |
| 279 | +SWIFT_CC(swift) SwiftExecutorRef swift_task_getMainExecutorImpl(void); |
281 | 280 |
|
282 | 281 | /// Check if the specified executor is the main executor. |
283 | 282 | SWIFT_CC(swift) bool swift_task_isMainExecutorImpl(SwiftExecutorRef executor); |
284 | 283 |
|
285 | 284 | /// Drain the main executor's queue, processing jobs enqueued on it; this |
286 | 285 | /// should never return. |
287 | 286 | SWIFT_RUNTIME_ATTRIBUTE_NORETURN SWIFT_CC(swift) void |
288 | | - swift_task_asyncMainDrainQueueImpl(); |
| 287 | + swift_task_asyncMainDrainQueueImpl(void); |
289 | 288 |
|
290 | 289 | /// Hand control of the current thread to the global executor until the |
291 | 290 | /// condition function returns `true`. Support for this function is optional, |
|
0 commit comments