linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kevin P. Fleming" <kpfleming@starnetworks.us>
To: unlisted-recipients:; (no To-header on input)
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/6] 2.4.19-rc1 number() stack reduction
Date: Mon, 10 Jan 2005 12:50:36 -0700	[thread overview]
Message-ID: <41E2DC8C.6080101@starnetworks.us> (raw)
In-Reply-To: <1105378775.4000.138.camel@dyn318077bld.beaverton.ibm.com>

Badari Pulavarty wrote:

> + /* Move these off of the stack for number().  This way we reduce the
> +  * size of the stack and don't have to copy them every time we are called.
> +  */
> +const char small_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
> +const char large_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
> +
>  static char * number(char * buf, char * end, long long num, int base, int size, int precision, int type)
>  {
>  	char c,sign,tmp[66];
>  	const char *digits;
> -	static const char small_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
> -	static const char large_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

Is this actually correct? Since these are declared "static const", they 
are not on the stack anyway, because they have to persist between calls 
to this function and cannot be changed. I'd be very surprised if the 
compiler was copying this data from the static data segment to the stack 
on every entry to this function.

  reply	other threads:[~2005-01-10 20:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-10 17:35 [PATCH 0/6] 2.4.19-rc1 stack reduction patches Badari Pulavarty
2005-01-10 17:38 ` [PATCH 1/6] 2.4.19-rc1 do_execve() stack reduction Badari Pulavarty
2005-01-10 17:39 ` [PATCH 2/6] 2.4.19-rc1 number() " Badari Pulavarty
2005-01-10 19:50   ` Kevin P. Fleming [this message]
2005-01-10 21:33     ` Badari Pulavarty
2005-01-10 21:29   ` Badari Pulavarty
2005-01-10 17:40 ` [PATCH 3/6] 2.4.19-rc1 nfs_lookup stack reduction patch Badari Pulavarty
2005-01-10 17:41 ` [PATCH 4/6] 2.4.19-rc1 nfs revalidate_inode() stack reduction patches Badari Pulavarty
2005-01-10 17:41 ` [PATCH 5/6] 2.4.19-rc1 rpc_call_sync() stack reduction patch Badari Pulavarty
2005-01-10 17:42 ` [PATCH 6/6] 2.4.19-rc1 xprt_sendmsg() " Badari Pulavarty
2005-01-11  7:39 ` [PATCH 0/6] 2.4.19-rc1 stack reduction patches Arjan van de Ven
2005-01-11  7:49   ` Marcelo Tosatti
2005-01-11 11:18     ` Arjan van de Ven
2005-01-11 10:17       ` Marcelo Tosatti

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=41E2DC8C.6080101@starnetworks.us \
    --to=kpfleming@starnetworks.us \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).