Frank Heckenbach wrote:
Waldek Hebisch wrote:
It looks that you are passing large arrays by value. Such arrays may cause problems at runtime due to limit on stack usage (by default 10Mb on Linux) -- arguments are passed by value and consume stack space. Unfortunatly, such array consume even more space in the compiler.
But only if they are initialized field by field or something like that, shouldn't they?
Am I missing something? AFAICS, Marten didn't show any actual code. The following program compiles fine for me (but crashes with stack overflow when trying to run it).
program Foo;
type a = array [1 .. 100000000] of Integer;
var v: a;
procedure p (v: a); begin end;
begin p (v) end.
Compiles fine with 3.2.3. Crashes with 3.3.3 and 3.4.0. With 20Gb stack limit compiles fine. The following compiles with 2.95.3 but crashes with 3.x:
program foo(output); type ta = string(20000000); var a, b : ta; procedure bar(v : ta); begin write(v) end; procedure baz(u, w : ta); begin write(u); bar(w) end; begin baz(a,b); writeln end .
If I increase stack limit then 3.x works OK.