3 ms·
Forgive my lack of exposure to safety-critical C, but without dynamic allocation how does a program handle large state with indeterminate lifetimes? Or when you
by DaiPlusPlus 3y ago
Forgive my lack of exposure to safety-critical C, but without dynamic allocation how does a program handle large state with indeterminate lifetimes? Or when you need a temporary buffer that’s too big to live on the stack?
- RealityVoid 3y agoYou make the stack bigger. You might think I'm joking, but I'm not. Or you make it static. You can work around it just fine.
- BeetleB 3y ago> but without dynamic allocation how does a program handle large state with indeterminate lifetimes? If you haven't, I strongly encourage taking a workshop/course on requirements engineering (not specific to SW nor safety). One thing that stood out is a requirement that says things like "indeterminate" or "large" are red flags. A requirement should state bounds on what sizes it should handle. > Or when you need a temporary buffer that’s too big to live on the stack? Do you have an example of where this may occur in a safety critical system? I've forgotten the details, but many/most forbidden things are allowed in the code provided you have watchdogs for mitigation - so if things did fail it could safely shut down. I don't recall if dynamic allocation fell into that category.
- rurban 3y agolarge state is too complicated and error prone. cut it down. don't put big temp. buffers onto the stack, put them into your .data segment. (i.e. global).