From: Alex Riesen <raa.lkml@gmail.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: [ANNOUNCE] udev 046 release
Date: Sat, 20 Nov 2004 18:40:58 +0000 [thread overview]
Message-ID: <81b0412b04112010404310e8b2@mail.gmail.com> (raw)
In-Reply-To: <20041118224411.GA10876@kroah.com>
On Fri, 19 Nov 2004 14:58:44 -0800, Greg KH <greg@kroah.com> wrote:
> > > > I've released the 046 version of udev. It can be found at:
> > > > kernel.org/pub/linux/utils/kernel/hotplug/udev-046.tar.gz
> > > I just put const's at some places. It cut down data segments, but
> > > increased code size.
> > > Overall still smaller:
>
> What version of gcc are you using that causes this to happen? And why
> does it happen? Why does the compiler think it can pack these
> structures better if they are const *?
I have 3.3.4, but I'm almost sure it shall happen with any compiler: no compiler
has given the knowledge that the structures will be never changed in any way.
So it can use the same storage for the equal string constants, for example.
With the knowledge it must assume you will change contents of the constants
sometime, and have to allocate the space for them separately. IOW, they are
not constants, just initializers. But, in fact, they are, hence the
suggestion to help
the compiler by declaring them const
> > > Also, the instance of utsname in udev_lib.c is used only once.
...
> > * utsname used only once
...
> > int kernel_release_satisfactory(int version, int patchlevel, int sublevel)
> > {
> > - static struct utsname uts;
> > static int kversion = 0;
> > static int kpatchlevel;
> > static int ksublevel;
> >
> > if (kversion = 0) {
> > + struct utsname uts;
> > if (uname(&uts) != 0)
> > return -1;
> No, this should be fixed up to only call uname once. We do call it
> multiple times from the same program, and that could be optimized.
No, you don't call it (uTSname) multiple times. kversion is static
(and even initialized to 0).
-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
next prev parent reply other threads:[~2004-11-20 18:40 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-18 22:44 [ANNOUNCE] udev 046 release Greg KH
2004-11-19 9:58 ` Alex Riesen
2004-11-19 10:00 ` Alex Riesen
2004-11-19 11:26 ` Mathieu Segaud
2004-11-19 14:42 ` Kay Sievers
2004-11-19 14:49 ` Mathieu Segaud
2004-11-19 15:45 ` Mathieu Segaud
2004-11-19 22:48 ` Greg KH
2004-11-19 22:58 ` Greg KH
2004-11-19 23:20 ` Paul Jackson
2004-11-19 23:47 ` Greg KH
2004-11-20 18:40 ` Alex Riesen [this message]
2004-11-22 19:52 ` Greg KH
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=81b0412b04112010404310e8b2@mail.gmail.com \
--to=raa.lkml@gmail.com \
--cc=linux-hotplug@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).