RE: [U-Boot-Users] memory allocation

Is there a (good) reason why the mem_alloc_init for ARM (and some other) targets zeroes out the malloc pool?
Paranoia?
That incompetent software developers flood your mailbox?
BTW: the same is done on other architectures, too.
But not for all - so one way or the other, it's not correct. Unless there is less paranoia for certain architectures ;-)
This seems very redundant to me. I removed the memset code and didn't run into any trouble so far, but maybe I was just lucky.
We do a lot of redundand things that help to improve styability ;-)
I consider zeroeing out this memory area as a way to obscure bugs, by allowing faulty code to run nevertheless. I guess it's a thin line between improving stability and catering bad code.
Anyway, I've noted this as 'intended by design' and keep the removal local.
Best regards, Lars Friedrich

Dear Lars,
in message 96A7A8B8A8ACBA4DAF7FD558BD32799BF56086@svex01001 you wrote:
BTW: the same is done on other architectures, too.
But not for all - so one way or the other, it's not correct. Unless there is less paranoia for certain architectures ;-)
...or different developers.
I consider zeroeing out this memory area as a way to obscure bugs, by allowing faulty code to run nevertheless. I guess it's a thin
This is one way to see things. Another one is that zeroing the memory is a simple but efficient way to make sure that this memory is really writable. Remember that we often have to deal with green hardware which may fail in funny ways, or with the effects of mis-configured systems (like setting a size for the malloc arena that is bigger than the available RAM), etc. This simple memset() gives you a pretty clear indication of such errors.
line between improving stability and catering bad code.
In this case I tend to disagree.
Best regards,
Wolfgang Denk
participants (2)
-
Friedrich, Lars
-
Wolfgang Denk