|
|
|
|
|
by zaarn
2537 days ago
|
|
Segfaulting and OOM on MCU's is far more rare than on a device with an entire operating system on top. In most cases, MCU IDE's like the classic Arduino one don't even give you an allocator, all data must be statically allocated beforehand. IIRC it doesn't use the stack either. The main() and loop() functions initialize all their variables statically. When you have 2KB of memory to share between code, data and stack, allocating and using stack for function calls is luxury that only introduces problems. Hence, I've never ever ever seen an MCU crash from segfaults or OOMs. On the plus side they will also use vastly less energy. 10 Milliamps is enough to drive a ESP8266 or ESP32, in deep sleep you start counting microamps. A single battery cell can easily last a month. |
|