|
28 | 28 | #include "Debug.h" |
29 | 29 | #include "Error.h" |
30 | 30 | #include <atomic> |
| 31 | +#include <new> |
31 | 32 |
|
32 | 33 | #if SWIFT_CONCURRENCY_ENABLE_DISPATCH |
33 | 34 | #include <dispatch/dispatch.h> |
@@ -770,20 +771,20 @@ static AsyncTaskAndContext swift_task_create_commonImpl( |
770 | 771 | // Initialize the child fragment if applicable. |
771 | 772 | if (parent) { |
772 | 773 | auto childFragment = task->childFragment(); |
773 | | - new (childFragment) AsyncTask::ChildFragment(parent); |
| 774 | + ::new (childFragment) AsyncTask::ChildFragment(parent); |
774 | 775 | } |
775 | 776 |
|
776 | 777 | // Initialize the group child fragment if applicable. |
777 | 778 | if (group) { |
778 | 779 | auto groupChildFragment = task->groupChildFragment(); |
779 | | - new (groupChildFragment) AsyncTask::GroupChildFragment(group); |
| 780 | + ::new (groupChildFragment) AsyncTask::GroupChildFragment(group); |
780 | 781 | } |
781 | 782 |
|
782 | 783 | // Initialize the future fragment if applicable. |
783 | 784 | if (futureResultType) { |
784 | 785 | assert(task->isFuture()); |
785 | 786 | auto futureFragment = task->futureFragment(); |
786 | | - new (futureFragment) FutureFragment(futureResultType); |
| 787 | + ::new (futureFragment) FutureFragment(futureResultType); |
787 | 788 |
|
788 | 789 | // Set up the context for the future so there is no error, and a successful |
789 | 790 | // result will be written into the future fragment's storage. |
@@ -1202,7 +1203,7 @@ swift_task_addCancellationHandlerImpl( |
1202 | 1203 | void *allocation = |
1203 | 1204 | swift_task_alloc(sizeof(CancellationNotificationStatusRecord)); |
1204 | 1205 | auto unsigned_handler = swift_auth_code(handler, 3848); |
1205 | | - auto *record = new (allocation) |
| 1206 | + auto *record = ::new (allocation) |
1206 | 1207 | CancellationNotificationStatusRecord(unsigned_handler, context); |
1207 | 1208 |
|
1208 | 1209 | bool fireHandlerNow = false; |
@@ -1237,7 +1238,7 @@ swift_task_createNullaryContinuationJobImpl( |
1237 | 1238 | void *allocation = |
1238 | 1239 | swift_task_alloc(sizeof(NullaryContinuationJob)); |
1239 | 1240 | auto *job = |
1240 | | - new (allocation) NullaryContinuationJob( |
| 1241 | + ::new (allocation) NullaryContinuationJob( |
1241 | 1242 | swift_task_getCurrent(), static_cast<JobPriority>(priority), |
1242 | 1243 | continuation); |
1243 | 1244 |
|
|
0 commit comments