[fpc-pascal] optimization of "inline" open array constants
skalogryz.lists at gmail.com
Wed Jul 23 18:09:12 CEST 2014
Here's the code:
procedure dump(const a: array of string);
i : integer;
for i:=0 to length(a)-1 do
fast : array [0..2] of string = ('aa','bb','cc');
The first call to dump(), where the array is passed as "inline"
declaration, consists of building of an open array with string constants:
the second call, is however just passing a reference to the constant of the
open array ("fast")
Question: would it be reasonable for the compiler to turn an inline
declaration of ['a','b','c'], into a constant implicitly?
That would save some instructions to make a call
is there an optimization switch for that already?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal