largest array size

largest array size

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

2 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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

发表评论

登录添加评论。还不是成员?立即加入