Re: How to reduce Zero Initialised region.



Thad Smith wrote:

Ajai Jose wrote:
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.

Why do you want to reduce the size of only zero-initialized RAM?

Because that's what they're running out of. It's an embedded system:
some of them have Funny Specifications. I /suspect/, given that it's
an ARM, that there's some zero-initialised memory that's directly
addressable from a dedicated register and hence is only 4K wide.
(If you don't have a dedicated register you need to load the
address into a spare register before addressing, which means either
loading a pointer you /can/ directly address, which, since we've
eliminated "directly addressed from a dedicated register", means
"directly addressed via the PC", which means you may have multiple
copies of the constant lying around, bad news for embedded; or you
have to assemble the constant in-line, taking at least one and
maybe more instructions, ditto.) But that's just an off-topic guess.

--
Chris "electric hedgehog" Dollin
"The path to the web becomes deeper and wider" - October Project

.