64-Bit VB.NET Allocating > 2GB of RAM (.NET bug?)

前端 未结 4 1163
日久生厌
日久生厌 2021-01-13 11:01

I have a 64 bit VB.NET application and want to allocate a buffer > 2GB in size.

In the following code both the \"new\" and the \"ReDim\" throw an \"OverflowException

4条回答
  •  鱼传尺愫
    2021-01-13 11:37

    The following works [in theory] (C# syntax):

    Array.CreateInstance(typeof(int[]), 0L);
    

    Edit: Make a type with a fixed-size allocated array of 1GB arrays. You can re-index in the Item property via a shift.

提交回复
热议问题