我正在尝试创建一个byte长度为s 的数组UInt32.MaxValue.这个数组本质上是一个小的(ish)内存数据库:
byte[] countryCodes = new byte[UInt32.MaxValue];
Run Code Online (Sandbox Code Playgroud)
但是,在我的机器上,在运行时,我得到一个System.OverflowException"算术运算导致溢出".
这是怎么回事?我需要使用unsafe块malloc吗?我怎么会在C#中做到这一点?