- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page