porting 32bit code to 64bit ?

Windows specific forum
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

porting 32bit code to 64bit ?

Post by sartic »

Trying to find clear list what is different. Any url?

In theory 32bit programs are little slower than 64bit on 64bit host. 32 bit program can reach "only" 2 GB (I do not see any purpose now programming more :).
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: porting 32bit code to 64bit ?

Post by IdeasVacuum »

Well, it's not a 'port', it's a compile. Compile your 32bit code on 64bit Windows with 64bit PB and see what happens. You may have implemented API calls and or PB Libs that are 32bit only. Your first attempt at compiling will highlight some issues if they are there.......
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: porting 32bit code to 64bit ?

Post by c4s »

The PureBasic Team blog might give you some help and ideas:

Porting your programs to PureBasic 64bit -> http://www.purebasic.fr/blog/?p=42
Is your 64bit program really solid ? -> http://www.purebasic.fr/blog/?p=172
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
sartic
Enthusiast
Enthusiast
Posts: 143
Joined: Thu Aug 26, 2010 8:26 am

Re: porting 32bit code to 64bit ?

Post by sartic »

I read it but didn't understand it full. It should be more clear differences side by side.
There are even differences in 32bit programs under 64bit host. Example Sticky Window last 'till using 'normal' for window etc.
Registered user of PB (on Linux Mint 21.1 & Win 10 64bit)
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: porting 32bit code to 64bit ?

Post by IdeasVacuum »

This advice from Freak is important:
Do NOT use Get/SetWindowLong_() for subclassing anymore. These remain 32bit even on x64. Use Get/SetWindowLongPtr_() instead, which works correctly everywhere. There is really no need to use SetWindowLong_() over SetWindowLongPtr_() actually, so best do a search and replace and replace all of them right away.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply