From: Andrew Clausen <clausen@gnu.org>
To: "Randy.Dunlap" <randy.dunlap@verizon.net>
Cc: aia21@cantab.net, linux-kernel@vger.kernel.org,
linux-ntfs-dev@lists.sourceforge.net
Subject: Re: [Linux-NTFS-Dev] [PATCH] reduce large stack usage
Date: Sat, 1 Mar 2003 20:44:55 +1100 [thread overview]
Message-ID: <20030301094454.GA1058@gnu.org> (raw)
In-Reply-To: <3E605BEF.89DB801F@verizon.net>
Hi Randy,
On Fri, Feb 28, 2003 at 11:06:23PM -0800, Randy.Dunlap wrote:
> This patch to 2.5.63 reduces stack usage in generate_default_upcase()
> from 0x3d4 bytes to just noise (on x86).
>
> The arrays are static so they are still private (hidden), but
> now they aren't allocated on the stack and copied there for
> temp use.
BTW, you can declare "local" variables inside a function as static,
which makes them "global", but locally scoped. The code should be
basically equivalent, but perhaps more elegant...
i.e.:
uchar_t *generate_default_upcase(void)
{
- const int uc_run_table[][3] = { /* Start, End, Add */
+static const int uc_run_table[][3] = { /* Start, End, Add */
{0x0061, 0x007B, -32}, {0x0451, 0x045D, -80}, {0x1F70, 0x1F72, 74},
{0x00E0, 0x00F7, -32}, {0x045E, 0x0460, -80}, {0x1F72, 0x1F76, 86},
{0x00F8, 0x00FF, -32}, {0x0561, 0x0587, -48}, {0x1F76, 0x1F78, 100},
Cheers,
Andrew
next prev parent reply other threads:[~2003-03-01 9:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-01 7:06 [PATCH] reduce large stack usage Randy.Dunlap
2003-03-01 9:44 ` Andrew Clausen [this message]
2003-03-01 17:42 ` [Linux-NTFS-Dev] " Randy.Dunlap
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=20030301094454.GA1058@gnu.org \
--to=clausen@gnu.org \
--cc=aia21@cantab.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ntfs-dev@lists.sourceforge.net \
--cc=randy.dunlap@verizon.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.