Kostik Belousov wrote:
On Sun, Sep 28, 2008 at 12:55:42PM -0700, Xin LI wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Kostik Belousov wrote:
On Sat, Sep 27, 2008 at 12:09:10AM +0000, Xin LI wrote:
delphij 2008-09-27 00:09:10 UTC
FreeBSD src repository
Modified files:
sbin/init init.c
Log:
SVN rev 183391 on 2008-09-27 00:09:10Z by delphij
Static-ify procedures in init(8).
Revision Changes Path
1.66 +79 -79 src/sbin/init/init.c
What is a reason for the change ?
This would reduce the size of generated binary...
I am quite curious. Could you, please, show the numbers.
Is the reduction in size is due to function inlining, or it is purely
symbol table size issue ?
If a function or variable can be made static, it should be. There is
basically not excuse not to do so. In fact, it is considered a design
flaw of C, that symbols default to external linkage instead of internal
by default. The compiler can do more optimisations on things, it knows
it is the only user of. For example it can change the calling convention
of functions to pass parameters in registers instead of on the stack, if
it knows all callers. If a function is not static, it must assume there
are callers, which it has not control of. Changing the calling
convention is just one example of possible optimisations. Further it
reduces the chances of name clashes with functions local to other
translation units.
Regards
Christoph
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "[EMAIL PROTECTED]"