mirror of https://github.com/ArduPilot/ardupilot
AP_Scheduler: use NEW_NOTHROW for new(std::nothrow)
This commit is contained in:
parent
c1bdf15c1d
commit
5af89a4291
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue