Are there any collection classes or special data t

2019-02-19 15:09发布

问题:

I am currently using VS 2008 64 bit edition, 3.5 framework with SP1. However, it appears that the collection classes like List have a limit of 2^31 (or max value of an int) elements that it can contain.

Does anyone know if there are any true 64 bit collections that can handle more than 2^31 elements within a container? If not for VS 2008, then what about VS 2010? Any 3rd party collections out there that do this?

回答1:

I am pretty sure there are no builtin collections that can handle more than Int32.MaxValue entries. The reason is because the .NET Framework still has ~2GB limit for objects even for the 64-bit version. Int32.MaxValue entries of one byte bumps up against this limit. I believe Mono's memory limit is larger, but I cannot definitely confirm that.

You can work around this limitation using the BigArray implemenation from here.