I think I found the answer myself.
Using the compiler option ROCONST (which is NOT the default with C
programs),
you can specify that variables with the const attribute not be moved to
the WSA - that
is, the const attribute is respected. Otherwise (NOROCONST) it is ignored.
This is the default with C (not with C++).
Another way is using #pragma variable (variable_name, norent) for every
such large
read-only table, which has the same effect.
Any further suggestions?
Thank you, have a nice day and weekend.
Bernd
Am 24.08.2012 12:37, schrieb Bernd Oppolzer:
Hello all,
we have some modules written in C that have large arrays with constants.
For some reasons we are forced to compile those modules using the RENT
compiler option, which moves those arrays to the WSA (writable storage
area)
at runtime, which is not a desired behaviour, because this way, the
storage is
occupied twice - once ín the WSA and second in the initialization area
in the
STATIC CSECT - and there is coding needed at startup to move the
constants
into the WSA.
We are not able to move to NORENT due to site conventions.
Now my question: is it sufficient to mark those arrays with the const
attribute,
that is
static const double tab [100000] = { ... values follow ... };
or are there special #pragmas needed to prevent this table from being
moved to the WSA, given the RENT compiler option?
Kind regards
Bernd
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN