AP_Scheduler: use NEW_NOTHROW for new(std::nothrow)

This commit is contained in:
Andrew Tridgell 2024-05-27 11:24:14 +10:00
parent c1bdf15c1d
commit 5af89a4291
2 changed files with 2 additions and 2 deletions

View File

@ -125,7 +125,7 @@ void AP_Scheduler::init(const AP_Scheduler::Task *tasks, uint8_t num_tasks, uint
_num_tasks = _num_vehicle_tasks + _num_common_tasks;
_last_run = new uint16_t[_num_tasks];
_last_run = NEW_NOTHROW uint16_t[_num_tasks];
_tick_counter = 0;
// setup initial performance counters

View File

@ -40,7 +40,7 @@ void AP::PerfInfo::ignore_this_loop()
// allocate the array of task statistics for use by @SYS/tasks.txt
void AP::PerfInfo::allocate_task_info(uint8_t num_tasks)
{
_task_info = new TaskInfo[num_tasks];
_task_info = NEW_NOTHROW TaskInfo[num_tasks];
if (_task_info == nullptr) {
DEV_PRINTF("Unable to allocate scheduler TaskInfo\n");
_num_tasks = 0;