Maximum array size

Walter Bright newshound at digitalmars.com
Wed Apr 26 13:18:59 PDT 2006


Ivan Kazmenko wrote:
> Still, a question remains: what's the reason for such a limit?

1) Most of the time, such huge static arrays are the result of a typo.

2) It's not practical for the compiler to determine what the maximum 
amount is. So very large static arrays will not reliably work, and there 
will be bug reports filed about why the executable mysteriously fails to 
load, etc.

3) Such an executable may load, but may cripple the system.

4) A 16Mb limit gives a reasonable chance of the program being portable.

5) If initialized data is put into such an array, the executable size 
will grow by the size of the array.

6) Optlink has some troubles with very large static data.

7) Such arrays can easily be just allocated dynamically at runtime.



More information about the Digitalmars-d mailing list