First working Win64 program!

Sean Cavanaugh WorksOnMyMachine at gmail.com
Sun Aug 12 17:59:50 PDT 2012


On 8/12/2012 6:43 PM, torhu wrote:
> On 12.08.2012 23:21, Sean Cavanaugh wrote:
>>
>> Post windows 8 launch we should start seeing mainstream games shipping
>> 32 and 64 bit binaries together in the same box. We already have moved
>> off of 32 bit in house for our editors and tools. The biggest hangup is
>> Microsoft keeps shipping 32 bit OSes, and we still have to support XP at
>> least through the end of the year. With a little luck Win8 will be the
>> last 32 bit one.
>>
>
> Can I ask, what are the reasons you want to move to 64 bits on the
> Windows platform? Is it higher memory requirements or something else?
> The game with the highest memory use I've got installed is AFAIK
> Starcraft II, still at only about one GB. And as you know, 64 bit apps
> can have lower performance than 32 bits in some cases. So I'm curious to
> know what the reasons are in your case.

   32 bit Windows games are capped at around 1.3 GB due to WinXP 
support.  You can get closer to 1.7 GB of address space out of your 32 
bit apps when run under 64 bit windows, but thats about it, without 
playing with /3GB LARGEADDRESSAWARE flags etc.  Games that push 1.3 GB 
or more run the risk of crashing due to both address space fragmentation 
and running out of memory from the heap.

   In XP, you also run the risk of crashing when alt-tabing out of the 
game and back.  The video card's address space gets unmapped while you 
are away, and the app might have fragmented your nice 512 MB of 
contiguous while processing in the background, which causes the driver 
to fail to map the device back into your address space when you alt-tab 
crash, in a pretty much unrecoverable error.  Vista fixed this by 
mapping the resources to the address space when you lock the resources, 
instead of a huge chunk of the video card when the app had an open and 
valid (not-lost) device context.

   Also, having the full address space opens up the ability to store 
game data into memory mapped files, which can greatly simplify loading 
data.  Halo was designed this way for the XBOX, though for the PC 
version we had to modify the code to handle loading to alternate 
addresses with patched fixups if some random dll had taken the prefered 
load address at startup.  Since it was done in 32 bits each level had 
the same load address, but in 64 bits you could give each environment 
its own address range, which makes it very nice for getting a new area 
loaded while you are playing in the previous one (run a separate thread 
to touch all the new pages etc).





More information about the Digitalmars-d-announce mailing list