Task doesn't like out-of-order frees, so for the sake of the POC, just use malloc/free

This commit is contained in:
Jonathan Grynspan
2025-11-05 08:58:05 -05:00
parent 6b0be103f7
commit 9bb6b990ec

View File

@@ -1112,8 +1112,7 @@ void TaskDependencyStatusRecord::performEscalationAction(
/**************************************************************************/
void AsyncTask::pushTimeSpentRunningRecord(void) {
void *allocation = _swift_task_alloc_specific(
this, sizeof(class TimeSpentRunningStatusRecord));
void *allocation = std::malloc(sizeof(class TimeSpentRunningStatusRecord));
auto record = ::new (allocation) TimeSpentRunningStatusRecord();
addStatusRecord(this, record,
@@ -1125,7 +1124,7 @@ void AsyncTask::pushTimeSpentRunningRecord(void) {
void AsyncTask::popTimeSpentRunningRecord(void) {
if (auto record = popStatusRecordOfType<TimeSpentRunningStatusRecord>(this)) {
record->~TimeSpentRunningStatusRecord();
_swift_task_dealloc_specific(this, record);
std::free(record);
}
}