"The total size of a static array cannot exceed 16Mb."

Oskar Linde oskar.lindeREM at OVEgmail.com
Mon Oct 1 23:44:22 PDT 2007


Vladimir Panteleev wrote:
> Why?
> 
> I posted a bug report yesterday, thinking it was just some accidentally left over code.
> But I noticed this statement in the documentation today. And, frankly, I don't understand why that limitation is there.
> 
> The problem with this restriction comes when using multi-dimensional arrays. Branched dynamic arrays are MUCH slower than rectangular/cubic/etc. static arrays - and this is a severe limitation for anyone wanting to work with large amounts of data (e.g. game maps). Of course I could work around this by calculating the positions manually using x*width+y, but I'd like to know the reason why this limitation was put there in the first place, and what's the reasoning behind it. No other compiled language that I used (C/C++/Delphi) has such a limitation.
> 
> The check is in mtype.c, line 1835 (DMD 1.021).

This is a reply from Walter last year:

http://www.digitalmars.com/d/archives/digitalmars/D/37038.html#N37071


-- 
Oskar



More information about the Digitalmars-d mailing list