问题描述
我目前使用的是 VS 2008 64 位版,3.5 框架和 SP1.但是,似乎像 List 这样的集合类可以包含的元素限制为 2^31(或 int 的最大值).
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.
有谁知道是否有任何真正的 64 位集合可以处理容器内超过 2^31 个元素?如果不是 VS 2008,那么 VS 2010 呢?任何 3rd 方系列都可以做到这一点?
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?
推荐答案
我很确定没有内置集合可以处理超过 Int32.MaxValue
条目.原因是因为 .NET Framework 即使对于 64 位版本,仍然有大约 2GB 的对象限制.Int32.MaxValue
一个字节的条目会超过这个限制.我相信 Mono 的内存限制更大,但我不能肯定.
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.
这篇关于.NET 3.5 中是否有支持超过 2 ^ 31 个项目的集合类或特殊数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!