31. Dynamic Memory Allocation-ii

Question.4

A developer calls new inside a motor control ISR that must complete within 10 microseconds:

void motor_isr() {
   uint8_t* cmd = new uint8_t[16];
   parse_command(cmd);
   delete[] cmd;
}

Why is this dangerous?

Need Help? Refer to the Quick Guide below

Select Answer

Restart quiz!