From: Jamie Lokier <jamie@shareable.org>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: "Bityutskiy Artem \(Nokia-D/Helsinki\)"
<Artem.Bityutskiy@nokia.com>,
linux-mtd@lists.infradead.org,
"Shevchenko Andriy \(EXT-Teleca/Helsinki\)"
<ext-andriy.shevchenko@nokia.com>
Subject: Re: [PATCH 2/3] flash_eraseall: move constants out of for loop
Date: Wed, 23 Jun 2010 01:23:35 +0100 [thread overview]
Message-ID: <20100623002334.GA22367@shareable.org> (raw)
In-Reply-To: <AANLkTilBFi58-kjjxM2Q5p0I1l9R5WQpiozBiV5udQYW@mail.gmail.com>
Mike Frysinger wrote:
> NAK: no explanation why you're doing this, and current code has the
> variables scoped to where they actually get used.
>
> i wonder though why this code even bothers with "static".
The array is static to avoid compiling to code which fills in the
array at runtime. I.e. it makes the code smaller, to the same size as
if they were globals. And then, only because its static, the const
can put them in the .rodata section, reducing unshared data size.
Because they're static there's no benefit to moving them to another
scope.
-- Jamie
next prev parent reply other threads:[~2010-06-23 0:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-17 8:42 [PATCH 1/3] mkfs.ubifs: check output first Shevchenko Andriy (EXT-Teleca/Helsinki)
2010-06-17 8:42 ` [PATCH 2/3] flash_eraseall: move constants out of for loop Shevchenko Andriy (EXT-Teleca/Helsinki)
2010-06-17 8:42 ` [PATCH 3/3] flash_eraseall: make -? option the same as --help Shevchenko Andriy (EXT-Teleca/Helsinki)
2010-06-22 17:31 ` Mike Frysinger
2010-06-22 17:33 ` [PATCH 2/3] flash_eraseall: move constants out of for loop Mike Frysinger
2010-06-23 0:23 ` Jamie Lokier [this message]
2010-06-23 2:11 ` Mike Frysinger
2010-06-24 0:39 ` Jamie Lokier
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=20100623002334.GA22367@shareable.org \
--to=jamie@shareable.org \
--cc=Artem.Bityutskiy@nokia.com \
--cc=ext-andriy.shevchenko@nokia.com \
--cc=linux-mtd@lists.infradead.org \
--cc=vapier.adi@gmail.com \
/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).