Skip to content

Comment on NASA JPL C Coding Standard [pdf]parent

Comments

What do pointers have to do with memory allocation? Pointers don't discriminate against the otherwise allocated.

That said, this system still uses a dynamic memory system - its somewhat non-optional when you use an operating system which has to maintain memory for stacks and its own resources.

These guidelines just forbid you to use the memory allocation routines after the task initialization phase to make memory allocation and usage completely predictable.

I brought up pointer indirections as a way of illustrating how stringent some of these rules are and what sorts of forces are at play. Sorry for muddying matters.

The point is that you can still do all of that stuff even on staticly allocated memory.

The other limitation in a lot of these systems is the underlying virtual memory system and some times there isn't one. Memory fragmentation issues are a huge problem when you have a couple kB to a few MB of physical RAM and a limited VM subsystem.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.