I don't know about "commonly". In my experience with embedded C, if you needed things you declared them statically and never used malloc. It's not like you're calling alloca and letting those pointers escape -- any (valid) pointer you might have is to a static allocation or memory mapped address.
C++ is a different game and I don't know anything about it though.
But yeah the way I read this is they don't use malloc, which is pretty standard. This is how I've heard it referred to many times, and nothing else makes any sense.
> I don't know about "commonly". In my experience with embedded C, if you needed things you declared them statically and never used malloc.
I mean, it's common enough that MISRA, the JSF standard, and the NASA standard all specifically call it out to allow it under these conditions.
> It's not like you're calling alloca and letting those pointers escape -- any (valid) pointer you might have is to a static allocation or memory mapped address.
You only need to call alloca on dynamically sized stack allocations. You can always leak pointers to fixed size objects by:
void* woah_dont_do_this(void) {
int value = 0;
return &value;
}
and boom, the pointer that gets returned is pointing at invalid memory. Of course, no one would write it like this, but it's way easier than you might think to accidentally do this once there's some abstraction.
C++ is a different game and I don't know anything about it though.
But yeah the way I read this is they don't use malloc, which is pretty standard. This is how I've heard it referred to many times, and nothing else makes any sense.