News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Maximum memory

Started by gofab, August 15, 2006, 04:08:22 PM

Previous topic - Next topic

gofab

Hi to everybody,
I just would want to know how much is the maximum dimension for an array in Masm32, is it possible to declare an array of 500 Mega byte??
(I know I can theoretically address 4Gbyte, so I assume I can use them like I want....)

Thank you in advance,
Fabrizio

hutch--

Fabrizio,

It is dictated by the OS, not the language but if you have enough memory you can allocate up to 2 gig using the system API calls. MASM handles these fine. I sometimes test procedures on 1 gig VOB files loaded directly into memory so it no big deal to do if the machine has enough memory.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

gofab

Hutch,

Thank you for the replay, I'll go to MSDN to see which API function I can useĀ  :boohoo:

Best regards, Fabrizio

Tedd

Sometimes when people refer to 'arrays' they mean for it to be allocated as a local variable. (Not that I'm saying you are, but just in case :wink)
'Allocating' large variables on the stack is not usually a good idea. In your case, using GlobalAlloc or HeapAlloc is fine for blocks of memory well over 500MB :U
(Though in certain cases HeapAlloc is limited to just under 512MB.. so maybe GlobalAlloc is preferable.)
No snowflake in an avalanche feels responsible.

gofab

Thank you Tedd,

I can save much time with your suggestions, now I must just have to test the suggestions, I will inform you about the result  ::)

u

For large arrays, it's best to use VirtualAlloc. Will work well on every Win OS.
Please use a smaller graphic in your signature.