Resources for memory management in embedded application

前端 未结 7 770
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-31 17:50

How should I manage memory in my mission critical embedded application?

I found some articles with google, but couldn\'t pinpoint a really useful practical guide.

7条回答
  •  抹茶落季
    2020-12-31 18:30

    Disclaimer: I've not worked specifically with DO-178b, but I have written software for certified systems.

    On the certified systems for which I have been a developer, ...

    1. Dynamic memory allocation was acceptable ONLY during the initialization phase.
    2. Dynamic memory de-allocation was NEVER acceptable.

    This left us with the following options ...

    • Use statically allocated structures.
    • Create a pool of structures and then get/release them from/back to the pool.
    • For flexibility, we could dynamically allocate the size of the pools or number of structures during the initialization phase. However, once past that init phase, we were stuck with what we had.

    Our company found that pools of structures and then get/releasing from/back into the pool was most useful. We were able to keep to the model, and keep things deterministic with minimal problems.

    Hope that helps.

提交回复
热议问题