Bruno Haible <[EMAIL PROTECTED]> writes:

> Wouldn't it be nice if gcc, by itself, would put initialized variables
> into BSS if the initializer is entirely zero/null/0.0 ?

No, since you have to be able to do just this as well.

> True. But the amount of VM you can save on non-array variables is
> tiny. I did the optimization for libX11. The savings was a few hundred
> bytes at most. Given a page size of 4096, this means that it saved the
> loading of 1 page from disk with a probability of 10%, and no gain
> with a probability of 90%.

I did the optimization for various libraries, espcially glibc.  And
the result was moving about 7kB from .data to .bss.  And these are 1
and 2 pages respectively which don't have to be loaded for every
single application on the system.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/lists/

Reply via email to