add test for out of memory when allocating tickinfo
[clinton/Smoothieware.git] / src / modules / robot / Block.cpp
index 855d6f1..09fd56a 100644 (file)
@@ -75,6 +75,10 @@ void Block::clear()
     if(tick_info == nullptr) {
         // we create this once for this block in AHB0 to save memory
         tick_info= (tickinfo_t *)AHB0.alloc(sizeof(tickinfo_t) * n_actuators);
+        if(tick_info == nullptr) {
+            // if we ran out of memory in AHB0 just stop here
+            __debugbreak();
+        }
     }
 
     for(int i = 0; i < n_actuators; ++i) {