A quick primer for virtual addressing in Windows that I found yields a bit more information.Chris_The_Great wrote:Not sure what you mean. The code should be able to handle up to 4GB without alteration, right? Thats the 32-bit limit. >4GB would require a 64-bit conversion of all the code. 2GB was just an artificial limit imposed by 32bit windows, as far as i know.
The way I understood it to work, is that the header flag in the executable (that programs like CFF Explorer can help edit), merely tells Windows how much virtual memory the process is allowed to address. By default, 32-bit apps are restricted to 2gb. When the flag is thrown to '1' in the exe, Windows lifts that limitation and the exe is free to address up to 4gb.
Conversely, when the application is compiled as natively 64-bit, the limitation is lifted to a max per the operating system's limits (I think 8tb for x64 in recent copies of Windows).
Having said all that, the only thing that really changes is that the limit has been lifted. Windows won't help the application to address more memory actively, nor will it assist in managing assets more efficiently. If the application tries, and the limit isn't there, it succeeds. But it has to be coded to actively go after as many resources as it wants. If you put artificial limits inside the code knowing it is 32-bit and therefore restricted, removing the OS limitation won't help in any way.
This is why most games can have the switch thrown, the limit lifted, and performance and resource management improve. They were never artificially limited, they just had the 2gb exe header flag limiting them from the OS's standpoint. Flipping that on helps the application by providing more natural addressable memory.
You could do as everyone else does - compile for 32-bit with no internal limits, and allow the header flag to be toggled on. But that belies other improvements that 64-bit compilation provide. 64-bit libraries are inherently more efficient from what I understand, and allow a more seamless expansion of associated code and resources when you need to.
I'm not a programmer, but this is how I understand it all to work, having used it over the past 10 years along with stuff like the /3gb switch. Now that we're moving ahead quickly into a 64-bit operating space for everyone, it doesn't make a lot of sense to release a game in 1-2 years and have it still be limited to 2gb.
Just my feedback, take with a grain of salt.

