Skip to content

Commit 6f3d923

Browse files
committed
ABI: convert some unsigned long to unsigned long long
This path is not yet ABI stable so take advantage to correct the storage. This ABI compatible on most platforms, however, is not compatible on Windows, which is a ILLP64 platform rather than ILP64. This extends the storage to 64-bits from 32-bits. In the process, it avoids some warnings on the windows builds as well.
1 parent 2c4f7b9 commit 6f3d923

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

include/swift/ABI/Task.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -343,16 +343,16 @@ class AsyncTask : public HeapObject, public Job {
343343
};
344344

345345
struct GroupStatus {
346-
static const unsigned long maskReady = 0x00FFFFF0000000000l;
347-
static const unsigned long oneReadyTask = 0x00000010000000000l;
346+
static const unsigned long long maskReady = 0x00FFFFF0000000000ll;
347+
static const unsigned long long oneReadyTask = 0x00000010000000000ll;
348348

349-
static const unsigned long maskPending = 0x0000000FFFFF00000l;
350-
static const unsigned long onePendingTask = 0x00000000000100000l;
349+
static const unsigned long long maskPending = 0x0000000FFFFF00000ll;
350+
static const unsigned long long onePendingTask = 0x00000000000100000ll;
351351

352-
static const unsigned long maskWaiting = 0x000000000000FFFFFl;
353-
static const unsigned long oneWaitingTask = 0x00000000000000001l;
352+
static const unsigned long long maskWaiting = 0x000000000000FFFFFll;
353+
static const unsigned long long oneWaitingTask = 0x00000000000000001ll;
354354

355-
unsigned long status;
355+
unsigned long long status;
356356

357357
unsigned int readyTasks() {
358358
return (status & maskReady) >> 40;
@@ -436,7 +436,7 @@ class AsyncTask : public HeapObject, public Job {
436436
mutable std::mutex mutex;
437437

438438
/// Used for queue management, counting number of waiting and ready tasks
439-
std::atomic<unsigned long> status;
439+
std::atomic<unsigned long long> status;
440440

441441
/// Queue containing completed tasks offered into this channel.
442442
///

0 commit comments

Comments
 (0)