Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

largest array size

ucgapam
Beginner
397 Views
Hello,

I'm trying to create a large array using malloc. I read on msdn that size_t is bounded at 0x7CFFFFFF. (You can assign anything up to 2^32-1, but the malloc will fail.)


I was wondering what was the upper bound of the Intel Compiler. By brute forcing I've got a value of 0x77A5FFE0 (first sucessful malloc). Is this it? Is there a constant somewhere with this magic number?

On a related note, is there any way to push this limit? (Perhaps in assembler, by-passing array fucntions and working directly with the heap?)

Thanks

Ucgapam

From msdn: (snip)

Microsoft Specific ?>

The type of integer required to hold the maximum size of an array is the size of size_t. Defined in the header file STDDEF.H, size_t is an unsigned int with the range 0x00000000 to 0x7CFFFFFF.

END Microsoft Specific
0 Kudos
1 Reply
Telnov__Alex
Beginner
397 Views
The virtual address space available to an application is limited to 2 GB on the 32-bit hardware platform. That's where 0x7CFFFFFF comes from (the practical limit is a few MBs smaller than that).

To overcome this limit, you have two alternatives:

- use a 64-bit operating system and compiler
- try to think of a way to do your calculations with less memory
0 Kudos
Reply