Skip to content

Commit aa2b4e3

Browse files
committed
[6.2][Concurrency] Fix task status and private storage sizes.
ActiveTaskStatusSize is 2 words, not 4, on most targets. PrivateStorageSize is measured in bytes, not words, so the Storage field needs to be a char[]. (cherry picked from commit d1cb5d9)
1 parent bd83ae1 commit aa2b4e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/swift/ABI/Task.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,15 +301,15 @@ class AsyncTask : public Job {
301301
#if SWIFT_CONCURRENCY_ENABLE_PRIORITY_ESCALATION && SWIFT_POINTER_IS_4_BYTES
302302
static constexpr size_t ActiveTaskStatusSize = 4 * sizeof(void *);
303303
#else
304-
static constexpr size_t ActiveTaskStatusSize = 4 * sizeof(void *);
304+
static constexpr size_t ActiveTaskStatusSize = 2 * sizeof(void *);
305305
#endif
306306

307307
// Private storage is currently 6 pointers, 16 bytes of non-pointer data,
308308
// the ActiveTaskStatus, and a RecursiveMutex.
309309
static constexpr size_t PrivateStorageSize =
310310
6 * sizeof(void *) + 16 + ActiveTaskStatusSize + sizeof(RecursiveMutex);
311311

312-
void *Storage[PrivateStorageSize];
312+
char Storage[PrivateStorageSize];
313313

314314
/// Initialize this storage during the creation of a task.
315315
void initialize(JobPriority basePri);

0 commit comments

Comments
 (0)