Author here. Firmware, for better and worse, is stuck in C/C++ land, so many of the topics here are essential to keep a complex, multi-MCU, multi-board setup in working order.<p>I'm actually really curious what you all do in C/C++ to <i>prevent</i> bad operations from ever being performed in the first place.<p>For example, should we just change our internal malloc / free to use double pointers instead?<p><pre><code> bool malloc(size_t n, void **ptr) {
*ptr = <memory>
}
void free(void **ptr) {
... <free>
*ptr = NULL
}
</code></pre>
This way, if anyone actually tries to use that pointer, it will crash the system (hardfault), instead of potentially using corrupted memory, which IMO is much worse.