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."
How can I allocate buffers > 2GB when these functions only accept signed 32 bit values?
(Is this possible in C#?)
Edit - I am running WinXP 64 with 4GB of RAM.
Dim width As Long = 19005
Dim height As Long = 32768
Dim buffer() As Byte = New Byte((width * height * 4) - 1) {}
Dim size As Long = (width * height * 4) - 1
ReDim buffer(size)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…