lkml.org 
[lkml]   [2005]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [RFC] cleanup patches for strings
Date
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.

----- Original Message -----
From: "Jesper Juhl" <juhl-lkml@dif.dk>
To: "linux-kernel" <linux-kernel@vger.kernel.org>
Cc: "Andrew Morton" <akpm@osdl.org>; "Jeff Garzik" <jgarzik@pobox.com>;
"Domen Puncer" <domen@coderock.org>
Sent: Monday, June 20, 2005 18:46
Subject: [RFC] cleanup patches for strings
> from the form
> [const] char *foo = "blah";
> to
> [const] char foo[] = "blah";

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

\
 
 \ /
  Last update: 2005-06-21 08:17    [W:0.373 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site