Dear Lei Wen, In message <1296788903-7604-1-git-send-email-lei...@marvell.com> you wrote: > Original env buf directly locate at stack lead large stack footprint > when call those env functions. It is not good when the system memory > is critical or only want the uboot run at restrict range, that is not > to touch the memory of other place at its best. > > So now this patch move the env buf to the heap area, which reduce the > area uboot need to touch.
In which way do you think this will save any memory? Your switch from automatic variables to manually allocated ones has, in my opinion several disadvantages: 1) It increases the code size. 2) It increases the probability of bugs like memory leaks etc. 3) Instead of using the stack, which gets allocated fully dynamically and gets freed guaranteed completely when the function returns, you now need at least the same space in the malloc arena - where you have to allocate it statically, and where allocations of buffers like that can easily lead to memory fragmentation, increasing the memory footprint further. Did you do any specific measurements of memory footprint, or what makes you believe your code is preferrable? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de As far as the laws of mathematics refer to reality, they are not cer- tain, and as far as they are certain, they do not refer to reality. -- Albert Einstein _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot