Re: [RFC] cleanup patches for strings

From: cutaway
Date: Tue Jun 21 2005 - 01:14:56 EST

Examine each case individually...

Any code that did a "sizeof(foo)" is [very] likely to give different

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

----- Original Message -----
From: "Jesper Juhl" <juhl-lkml@xxxxxx>
To: "linux-kernel" <linux-kernel@xxxxxxxxxxxxxxx>
Cc: "Andrew Morton" <akpm@xxxxxxxx>; "Jeff Garzik" <jgarzik@xxxxxxxxx>;
"Domen Puncer" <domen@xxxxxxxxxxxx>
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@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at