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

Vladimir Panteleev thecybershadow at gmail.com
Tue Oct 2 00:15:32 PDT 2007


On Tue, 02 Oct 2007 09:44:22 +0300, Oskar Linde <oskar.lindeREM at ovegmail.com> wrote:

> This is a reply from Walter last year:
>
> http://www.digitalmars.com/d/archives/digitalmars/D/37038.html#N37071

If you ask me, most of those reasons are excuses for 6). Putting restrictions on things which MAY hurt you IF you do things you're never going to do is, to put it softly, not a very good idea. A static array in the uninitialized part of the data segment allows me to randomly access any part of it very quickly, because its address and the address of every of its elements is predetermined at compile time, so - unlike with the case of dynamic arrays or pointers to static arrays - you do not need to dereference pointers every time. I'll say it again, D is the only compiled language that has such a limitation. 

As for point 5) - well, the executable grows by the size of the array regardless if the array has any initialization. Heck, it adds initialization data even if I use "=void".

-- 
Best regards,
 Vladimir                          mailto:thecybershadow at gmail.com



More information about the Digitalmars-d mailing list