|
|
|
|
|
by PinguTS
3446 days ago
|
|
If you want to talk about safety and reliability in automotive, then we talk about Autosar[1]. One of the concepts is to prevent the use of any dynamic behavior, which means you don't need any garbage collection at all. Because garbage collection is not predictable. It can be good and bad, but even a good one is not predictable. Embedded design and development is completely different to classical IT. For IT that sounds archaic. But it always proved right at the end. [1] https://en.wikipedia.org/wiki/AUTOSAR |
|
And regarding memory allocation in reliable automotive systems: Yes, the best practice would be not to allocate at all to get to some deterministic behavior. However I've seen lots of projects where "don't allocate" is implemented as "don't allocate with malloc", and you find dozens of custom memory allocators and pools throughout the code. Some of those designs are probably less reliable and safe than using a garbage collected language would be.