We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d920aa commit 315b26dCopy full SHA for 315b26d
src/TaskManagerIO.cpp
@@ -86,8 +86,14 @@ taskid_t TaskManager::findFreeTask() {
86
TmSpinLock spinLock(&memLockerFlag);
87
auto nextIdSpace = taskBlocks[numberOfBlocks - 1]->lastSlot() + 1;
88
taskBlocks[numberOfBlocks] = new TaskBlock(nextIdSpace);
89
- tm_internal::tmNotification(tm_internal::TM_INFO_REALLOC, numberOfBlocks);
90
- numberOfBlocks++;
+ if(taskBlocks[numberOfBlocks] != nullptr) {
+ tm_internal::tmNotification(tm_internal::TM_INFO_REALLOC, numberOfBlocks);
91
+ numberOfBlocks++;
92
+ }
93
+ else {
94
+ tm_internal::tmNotification(tm_internal::TM_ERROR_FULL, numberOfBlocks);
95
+ break; // no point to continue here, new has failed.
96
97
}
98
99
// count up the tries so far to allocate / wait for allocation.
0 commit comments