Michael,
In addition to the other comments:
| The System.Array class seems to be limited to 32 bit addresses,
| meaning that one can only assign 2^32 elements.
..NET 1.1 has "support" for large arrays in that there is an Array.LongLength
property (Int64) & Array.GetValue & Array.SetValue are overloaded for Long
(Int64).
http://msdn.microsoft.com/library/de...engthTopic.asp http://msdn.microsoft.com/library/de...alueTopic3.asp
| Is there any way that I can have an array that allows 2^64 elements?
| Or doesn't the CLR support this on a 32 bit opsys?
However! other then sparse arrays, which I'm not sure how much support
there is, how would you actually allocate said array? Remember that under 32
bit OS you can only index 4G of memory, of which the OS wants to keep 2G (1G
on some OSes) for itself, the runtime, your code, the stack, and other data
is going to use up part of the usable 2G, so the actually size of an Array
is going to be much smaller.
If I truly needed an "array" that is larger the 512M or so, I would consider
defining a new Type that used a file for the actual backing of the data &
read & write each element as needed. I would consider caching the elements
if performance became a problem. You could define this Type such that it
behaved like most normal collections.
Alternatively I have defined "Sparse Arrays", where I keep the "index" &
elements in a HashTable...
BTW: .NET 2.0
http://lab.msdn.microsoft.com/vs2005/ includes both a 32bit &
64bit runtime, so on a 64bit OS with the 64bit runtime you can have
obnoxiously large arrays... Whether you should or not is another discussion
;-)
Hope this helps
Jay
"Michael Gray" <fl****@newsguy.spam.com> wrote in message
news:d8********************************@4ax.com...
| VS 2003
| VB.net
| Win2000 SP4
|
| The System.Array class seems to be limited to 32 bit addresses,
| meaning that one can only assign 2^32 elements.
|
| Is there any way that I can have an array that allows 2^64 elements?
| Or doesn't the CLR support this on a 32 bit opsys?
| I suspect that I am going to have to make such a beastie myself...
|
| What about sparse arrays?