"The total size of a static array cannot exceed 16Mb."
BCS
ao at pathlink.com
Tue Oct 2 12:30:25 PDT 2007
Reply to Vladimir,
> On Tue, 02 Oct 2007 21:48:34 +0300, Walter Bright
> <newshound1 at digitalmars.com> wrote:
>
>> Vladimir Panteleev wrote:
>>
>>> Thanks, however dynamic arrays are unfortunately slow. To access a
>>> random element, you need a dereference, a multiplication+addition,
>>> another dereference, another multiplication+addition. Janice Caron's
>>> workaround, when modified to use a struct placed in the data
>>> segment, requires only one dereferencing/multiply+adding - while a
>>> static array placed in the data segment requires only arithmetics to
>>> access.
>>>
>> If you define an array as:
>>
>> int[10000][] a = new int[10000][100];
>>
>> only one dereference is required to access the data.
>>
> Yes, only one - when there should be none at all. *sigh*
>
Sorry, no can do. Even with stack based static arrays there is a single dereference.
An array access always does a dereference. (might you be thinking about indirects?)
More information about the Digitalmars-d
mailing list