简体   繁体   English

.NET Core / .NET 5 中的最大数组大小

[英]Max Array Size in .NET Core / .NET 5

So in the past, .NET Framework always had a maximum array size of UInt32.MaxValue even if you set gcAllowVeryLargeObjects in web.config.因此,在过去,.NET Framework 的最大数组大小始终为 UInt32.MaxValue,即使您在 web.config 中设置了 gcAllowVeryLargeObjects。

This was always terrible because, even on a 64-bit machine you couldn't make a large array.这总是很糟糕,因为即使在 64 位机器上,您也无法制作大型阵列。

So the question is: Did Microsoft finally fix this in .NET Core latest version / .NET 5?所以问题是:微软最终在 .NET Core 最新版本 / .NET 5 中解决了这个问题吗?

Any help would be greatly appreciated, the documentation on this issue is not good.任何帮助将不胜感激,关于这个问题的文档不好。 It's been 20 years, hopefully they finally fixed this.已经20年了,希望他们终于解决了这个问题。

The array size is limited to a total of 4 billion elements, and to a maximum index of 0X7FEFFFFF in any given dimension (0X7FFFFFC7 for byte arrays and arrays of single-byte structures).数组大小限制为总共 40 亿个元素,并且在任何给定维度中的最大索引为 0X7FEFFFFF(字节数组和单字节结构数组为 0X7FFFFFC7)。

Taken from Remarks 摘自备注

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM