Steve Sabram <[EMAIL PROTECTED]> writes:

> > me perplexed is that the size of my .PRC file is exactly the same either
> > way! I THOUGHT the size of my .PRC would shrink by approximately
> > 100*sizeof(my_structure), but it didn't shrink at all! So, two questions:
> >
> > 1. Why is my .PRC file the same size either way?
> 
> Because the you are conserving data memory with this technique and
> not code memory.  The PRC file is the amount of code NOT the amount
> of data used during execution.  The data space is only there are run
> time.

This is a little misleading. The PRC contains, in addition to the
program code, the initial data for initialized global variables. Since
your global array was uninitialized, the system can mark it as such,
and zero-fill it when the app starts. This avoids the storage of
100*sizeof(structure) bytes in the PRC. If your array had been
initialized with non-zero data, then it would have taken up noticable
space.

It's roughly analagous to data vs. bss segments in traditional desktop
applications, although the PRC format is a bit weirder.

        - Nathan

Reply via email to