|
|
|
|
|
by nine_k
22 days ago
|
|
I used to think that zero alloc = zero malloc, and all stack allocations are of statically known fixed size (you know the max call depth), so you can preallocate your stack area with some confidence, and will never run out of RAM. The line you point at creates a single local pointer variable which is used in a tight loop; I don't see why won't it stay entirely in a register. I'm not a real embedded developer though; last time I worked as one I worked on 8-bit devices. Maybe things changed since then. |
|
My bigger point was that no malloc should be called "stack allocated" or some other more technically correct term. That tells me "hey if you run this code and something goes haywire, check your stack isn't corrupted" because 9 times out of ten for me that's the problem.