Force 64 bit ints? RRS feed

  • Question

  • My application allocates several large arrays. Unfortunately, the allocating and accessing code always uses ints. This has limited the size of the array that can be allocated.

    I was wondering if there are any compiler options available that would simply force an int to be 64 bit. I would take a small memory hit overall, but it would help me avoid many weeks of work.

    Wednesday, February 20, 2008 3:03 PM


  • We have not expose such an option.


    In theory, one-dimension array in CLR accepts an native int as its it's length when constructed. Native int means Pointer-size integer. (32bit in x86 and 64bit in X64).


    So you can pass an Int64 as the length of the array. But it will still be converted to Int32 in 32bit application.


    And the maximum length of the array you can create depends on the "contiguous" address space

    Friday, February 22, 2008 7:06 AM