Henry Spencer <[EMAIL PROTECTED]> writes:

> Only in sloppy C implementations.  Initializing a variable *to zero* does
> not put it into .data if the implementation is being sensible.  Only
> variables initialized to non-zero values need to be in the .data section.

If an implementation does it it is completely broken since it would
prevent you from having an initialized variable with value zero
without using hacks like a section attribute.

> > Not initializing therefore descreases load time...
> 
> The difference is utterly insignificant unless the variables are large
> structs or arrays.

No.  The possibility that you have to map in another page increases by

        sizeof (var) * 100
        --------------------
              pagesize

with every variable.  Even a single of one byte can make a difference
if it will end up alone on a new page.

> No, it doesn't make the slightest difference to this.  Neither type of
> data section can be shared.  The only difference is that .data must be
> initialized from a disk copy, while .bss can be initialized by a CPU loop. 

Can be initialized by a CPU loop which is run in the OSes idle time!

-- 
---------------.                          ,-.   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