Re: How to reduce Zero Initialised region.



On Jan 31, 4:48 pm, "Samuel Stearley" <nya...@xxxxxxxxx> wrote:
1. Am I right in doing this (passing pointer instead of making the data structure static) ?

That will make the executable larger. How much increase can be
tolerated?


I mean passing an extra parameter to a function might increase code
size(text segment). Some additional code for sending the parameter
during function prolog. that is all the penalty right ?
but it will free some space of the ZI region when it comes to big
arrays.


2. Is there any alternative to this ?

In my experience people use UINT32s everywhere because they don't want
to look old fashioned. I suggest studying the values assigned to
datums in these structures. Maybe a UINT16 would work equally well.
But don't go around sticking UINT8s in the middle of a data structure.

-Samuel S

I understand what you are pointing at but I am particularly looking at
some huge global arrays which eat into the ZI region in a big way.
Small structures I have seen that the original developer has done a
good job.

Thx,
Ajai.


.