largest array size

largest array size


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?)



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

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

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

Leave a Comment

Please sign in to add a comment. Not a member? Join today