On Thu, Dec 9, 2010 at 11:32 AM, Sebastian Dransfeld <[email protected]> wrote: > On 12/09/2010 02:22 PM, Cedric BAIL wrote: >> On Thu, Dec 9, 2010 at 2:15 PM, Enlightenment SVN >> <[email protected]> wrote: >>> Log: >>> Reduce stack usage >>> >>> For functions often called, don't put unneded mem on stack >> >> That commit doesn't make anysense to me. tmp = alloca(PATH_MAX) is >> strictly the same as a char tmp[PATH_MAX]. And stack usage is only >> accounted when you use it all or jump to an inner function. I don't >> get what was your intent with that commit. > > I though the stack mem was allocated when it was defined. So the old > code would allocate when entering the function, and the new code when > reaching alloca. As we only once arrive at the alloca, my thought was > that it was an improvement. But it seems I don't know enough on how mem > is allocated and when.
I guess compilers are not that stupid these days, but even if they do, the stack presents no cost as it's just a register and not proportional to the bytes being used. -- Gustavo Sverzut Barbieri http://profusion.mobi embedded systems -------------------------------------- MSN: [email protected] Skype: gsbarbieri Mobile: +55 (19) 9225-2202 ------------------------------------------------------------------------------ This SF Dev2Dev email is sponsored by: WikiLeaks The End of the Free Internet http://p.sf.net/sfu/therealnews-com _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
