
Dear Tom,
In message 20131006204046.GN15917@bill-the-cat you wrote:
In message 1380227287-26057-3-git-send-email-trini@ti.com you wrote:
Switch the case of non-redundant non-embedded environment to use malloc to allocate buffers, rather than place them on the stack, like the redundant case does.
What exactly would be the benefit of this change? It just adds code size and execution time and makes the code more complex, without any appearent advanteages?
The main advantage is that we can use this code in environments with less than CONFIG_ENV_SIZE worth of stack available. Arguably it makes the behaviour and code paths similar for redundant and non-redundant cases (but someone posted a patch to make the redundant case use the stack).
Instead of stack size you pay for that with additional size of the malloc() arena. As I just explained in the other mail [1], this is even worse to deal with and will result in less memoy available for other purposes.
And yes, we definitely should use the stack for the redundant case as well. Do you want me to submit such a patch?
[1] http://article.gmane.org/gmane.comp.boot-loaders.u-boot/171217
Best regards,
Wolfgang Denk