> This is the key point, I think. What would work well on MCUs? What does > malloc do on these systems? standaloneheap might be fixable, I've always been > irrationally proud of this hack. :-)
haha, StandAloneHeap is a pretty great hack! It's one of the first things in the stdlib I read and thought: "that's pretty handy I like Nim's style". StandAloneHeap works well on Arduino's. On the ESP32 it was limited to like 1/2 of the RAM size due to linking issues. It had some limit on how large the static objects could be. One solution I thought about was copying StandAloneHeap and making a StandAloneMalloc that'd use malloc once upon initialization. Though it seems like StandAloneHeap would be prone to memory fragmentation? Honestly, I'm not sure how the ESP32's malloc works... except that it's pretty buggy. :/