4 ms·
Wow wow, if you are using a heap on really small embedded device you're gonna have a bad time any way. Embedded engineering 101: statically allocate everything
by omgtehlion 11y ago
Wow wow, if you are using a heap on really small embedded device you're gonna have a bad time any way.
Embedded engineering 101: statically allocate everything, and try not to push the stack too much. But you can not do this with JS :(
- phkahler 11y ago>> if you are using a heap on really small embedded device you're gonna have a bad time any way. Yep. malloc() is generally discouraged on those things and should be seen as a big red flag in any code review.
- chillingeffect 11y agoYes that is Embedded 101. How about 201, 301, 401 and the real world? Dynamic allocation happens. Parsing XML and OSC happens. Recording sequences of various lengths happens. It makes sense to apply intelligence to dynamic allocation.
- omgtehlion 11y agoIn a real world this is even more critical: you don't want, for example, your car brakes to fail because of OOM.
- RealityVoid 11y agoI think it really depends on your application. Car systems are pretty predictable with regards to messages received, they don't have random users sending impredictable data. I'm a SWE writing firmware for cars and I've got to admit, I never caught myself thinking: "Gee, I could sure use the heap right now!"