public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: "Ph. Marek" <marek@mail.bmlv.gv.at>, linux-kernel@vger.kernel.org
Subject: Re: some char * optimizations in kernel
Date: Fri, 23 Feb 2001 22:21:41 +0100	[thread overview]
Message-ID: <20010223222141.A563@bug.ucw.cz> (raw)
In-Reply-To: <3.0.6.32.20010222123207.009138d0@pop3.bmlv.gv.at>
In-Reply-To: <3.0.6.32.20010222123207.009138d0@pop3.bmlv.gv.at>; from Ph. Marek on Thu, Feb 22, 2001 at 12:32:07PM +0100

Hi!

> Hello everybody,
> 
> looking through the sources I found several pieces like
> lib/vsprintf.c, line 111:
> 	const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
> 
> As tested with egcs-2.91.60 even with -O3 there is a difference
> between 
> 	const char *digits="0123456789abcdefghijklmnopqrstuvwxyz";
> and
> 	const char digits[]="0123456789abcdefghijklmnopqrstuvwxyz";
> 
> in the resulting assembler code.
> 
> 
> Usage of this pointer results in it being loaded in a register, and then
> pushed on the stack (for subrouting using); if it's an array, the address
> is pushed directly.
> 
> Furthermore, in the "char *"-case the pointer is stored in memory.

It has to be, no matter of optimalization level. Some other module
might access that variable. You _could_ do static const char *..., but
it would probably not help.

> As I'm not at home I can't give a complete reference of all these cases.
> (But it's trivial [at least for me :-)] using perl).
> 
> So if this changes are approved and I have the time I can post a diff in
> the next few days.
> 
> 
> BTW: For which size of patch is it possible to get included in the "Hall of
> fame" (has helped with linux kernel)?

Try something bigger than this :-).

> And, btw too, where can I find a maintainer of a specific file? eg., one of
> these cases is in init/version.c which has "Copyright (C) 1992  Theodore
> Ts'o" - but I have to guess it's tytso@valinux.com.
> Is there something like Documentation/maintainers?

It is something like MAINTAINERS in root.

-- 
I'm pavel@ucw.cz. "In my country we have almost anarchy and I don't care."
Panos Katsaloulis describing me w.r.t. patents at discuss@linmodems.org

  reply	other threads:[~2001-02-24 19:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-22 11:32 some char * optimizations in kernel Ph. Marek
2001-02-23 21:21 ` Pavel Machek [this message]
2001-02-26  7:00 ` Ph. Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010223222141.A563@bug.ucw.cz \
    --to=pavel@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek@mail.bmlv.gv.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox