Re: How to reduce Zero Initialised region.



Ajai Jose a écrit :
Hi ,
I work on an ARM processor based embedded system. Code is mainly in
C language. The project has a huge source base. We are supposed to
optimise it. Most datastructures are declared as static and which
directly go into the Zero Initialised region. We need to cut the size
of this ZI region by at least 30%.
The one way i see of doing this is by removing these static arrays
and passing a pointer to the data structure whenever required. but
since these global arrays are used through out the code. A re-write
seems inevitable!

two questions I had.
1. Am I right in doing this(passing pointer instead of making the data
structure static) ?
2. Is there any alternative to this ?


Thanks in Advance,
Ajai.


Why do you think that this is the problem?

Did you measure the program's performance to see where the
hot spots are? What data leads you to your conclusion that
the static data is the problem?

If you pass pointers around it can be a better design but it will
be slightly slower, since global data needs nothing to be passed, it is
always there.

Before doing anything MEASURE FIRST!

jacob
.



Relevant Pages

  • How to reduce Zero Initialised region.
    ... directly go into the Zero Initialised region. ... The one way i see of doing this is by removing these static arrays ... and passing a pointer to the data structure whenever required. ... Am I right in doing this(passing pointer instead of making the data ...
    (comp.lang.c)
  • Re: using virtual function in c
    ... Here, the machine will convert &ii (a word pointer) to a byte pointer, ... If there is only one "virtual function" for a given data structure, ...
    (comp.lang.c)
  • Re: Why C for operating systems
    ... I have seen far too many hard-to-debug operating system bugs due to ... It would be far better if C pointer ... to be something related to the data structure. ... language functions to do specific jobs such as turning the address ...
    (comp.programming)
  • Re: Using sparse to catch invalid RCU dereferences?
    ... So the address_space attribute says what the pointer points to rather ... Probably because I am not the greatest gcc expert around... ... Then we would know that when tree lock is held the data structure is ... section with respect to another RCU-protected data structure. ...
    (Linux-Kernel)
  • Marshaling
    ... Actually it returns pointer to it. ... a pointer to a pointer to a copy of the data structure. ... According to this the date returned from WTSEnumerateSessions function is a ... DWORD Reserved, ...
    (microsoft.public.dotnet.framework)