The storage order
directive specifies the relative
order that storage should be allocated for the listed routine-local
variables and arrays. By appropriately positioning the arrays, cache
collisions can be reduced. If the compiler does not interpret the
storage order
directive, a loss of performance results,
but the program will nonetheless generate the correct results.
The rules governing the use of the C*$* storage order
directive are the following:
storage order
directive may
be used within a single program unit. Each directive may be
interpreted separately.
storage order
directive(s) will be
placed immediately after the PROGRAM statement or, if there is
no PROGRAM statement, before the first statement of the program
unit.
storage order
must be
local to the program unit.
storage order
directive
storage
order
directive with variables and arrays that are not.
storage order
directives.
C*$* storage order
directives as it considers useful. Specifically, the number
will not necessarily be limited to two (for SAVEd and non-SAVEd
variables).
storage order
directive.
To interpret a C*$* storage order
directive, the
compiler must place the named objects in memory in the order listed.
This is the same order as they would be placed in a COMMON block.
Thus, on a machine with 4 bytes per REAL variable:
C*$* storage order (A1,A2,A3) REAL A1(100), A2(3), A3(200) A1 would be placed at some address (for example, address X) A2 would be placed at X+100*4 A3 would be placed at X+100*4+3*4
Both static and stack-based storage schemes are allowed, as long as
all of the objects in a single storage order
directive
are placed in the same scheme.