Re: [RFC] cleanup patches for strings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tuesday 21 June 2005 09:58, [email protected] wrote:
> Examine each case individually...
> 
> Any code that did a "sizeof(foo)" is [very] likely to give different
> results.
> 
> Also, if there are several instances of "foo" being passed around as
> parameter, you may find the generated code gets somewhat worse if "foo" used
> to be a stack based autovar.  On x86, the const[] implementation will always
> cause a 5 byte PUSH for a parameter, whereas the autovar pointer
> implementation often will be a shorter 3 byte EBP relative push.  With many
> instances of 'foo' usage (or used in a loop), you may be better off paying
> the price of an autovar init during prolog to get the cheaper parm pushes
> later.

But that 3 byte push is fetching data from stack, while 5 byte const push
does not. I ike smaller code, but not _this_ much.

Also this smallish size advantage may be i386-specific only.
--
vda

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux