PB 6.10 beta 5 #PB_Any return value type changed?
PB 6.10 beta 5 #PB_Any return value type changed?
This beta seems to return much bigger values when using #PB_Any when creating gadgets, using c backend x64:
PB 6.04 35915776
PB 6.10b5 2537844711072
Wich value type is returning?
PB 6.04 35915776
PB 6.10b5 2537844711072
Wich value type is returning?
Re: PB 6.10 beta 5 #PB_Any return value type changed?
It is and was always integer (.i)
I think there was a change in memory management in the background.
But why you think it is a bug?
I think there was a change in memory management in the background.
But why you think it is a bug?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: PB 6.10 beta 5 #PB_Any return value type changed?
Not really a bug but something has changed for sure.
In a program that interacts with COM what previously was interpreted as a VT_I4 (4 byte signed int) now has become a VT_R8 (8 byte floating point) it caused the program to crash.
The returned gadget handles values seem to have widened, i would like to know what has changed internally with more detail.
In a program that interacts with COM what previously was interpreted as a VT_I4 (4 byte signed int) now has become a VT_R8 (8 byte floating point) it caused the program to crash.
The returned gadget handles values seem to have widened, i would like to know what has changed internally with more detail.
Re: PB 6.10 beta 5 #PB_Any return value type changed?
Not Double ...
Code: Select all
Define v1.VARIANT
v1\vt = #VT_I8
v1\llVal = adr
v1\vt = #VT_UI8
v1\ullVal = adr
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: PB 6.10 beta 5 #PB_Any return value type changed?
Here you can find my (and other's) old posts regarding this change: https://www.purebasic.fr/english/viewto ... 28#p572528Justin wrote: Sun Feb 04, 2024 9:12 pm Not really a bug but something has changed for sure.
In a program that interacts with COM what previously was interpreted as a VT_I4 (4 byte signed int) now has become a VT_R8 (8 byte floating point) it caused the program to crash.
The returned gadget handles values seem to have widened, i would like to know what has changed internally with more detail.
Please read also this blog post from freak:STARGÅTE wrote:Probably in older PB versions also the 64 bit version uses something like a virtual memory address per process.
In PB 6.00 is now uses the "real" memory position which is most often above a size of a long due to the huge RAM of 8 GB to 64 GB of typical PC systems.
But this is just speculation, I'm not familiar with this topic. Perhaps Fred can answer this question.
Is your 64bit program really solid ?
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: PB 6.10 beta 5 #PB_Any return value type changed?
mk-soft, i don't understand your point
stargate, thanks but those posts are from 2 years ago, the changes in gadget handles returned from #PB_Any, happen from 6.04 to 6.10b5 not sure in b4
stargate, thanks but those posts are from 2 years ago, the changes in gadget handles returned from #PB_Any, happen from 6.04 to 6.10b5 not sure in b4
Re: PB 6.10 beta 5 #PB_Any return value type changed?
We changed the linker, it probably added randomized address allocation by default to avoid memory attack prediction. That's a good thing anyway, it will help to track 64-bit code bug like you encountered.
-
juergenkulow
- Enthusiast

- Posts: 581
- Joined: Wed Sep 25, 2019 10:18 am
Re: PB 6.10 beta 5 #PB_Any return value type changed?
Is this line of code still correct? Protected.l FileNumber
Re: PB 6.10 beta 5 #PB_Any return value type changed?
It's indeed not correct, a #PB_Any result needs an integer (.i) type. I changed it.juergenkulow wrote: Mon Feb 05, 2024 10:12 am Is this line of code still correct? Protected.l FileNumber
Re: PB 6.10 beta 5 #PB_Any return value type changed?
So before 6.10 #PB_Any returned a long (4 bytes in x86/x64) and now returns an integer (4 bytes x86 / 8 bytes in x64)?
Thanks for the clarification.
Thanks for the clarification.
Re: PB 6.10 beta 5 #PB_Any return value type changed?
No, it never returned a long. It returned an integer which by luck was fitting into a long on x64. #PB_Any returns a real memory pointer, that's why it's always been integer (and not long). To have more info about the new linker memory default setting:
https://learn.microsoft.com/en-us/cpp/b ... w=msvc-170
https://learn.microsoft.com/en-us/cpp/b ... w=msvc-170
Re: PB 6.10 beta 5 #PB_Any return value type changed?
Wow Fred (and Freak).Fred wrote: Mon Feb 05, 2024 2:33 pm No, it never returned a long. It returned an integer which by luck was fitting into a long on x64. #PB_Any returns a real memory pointer, that's why it's always been integer (and not long). To have more info about the new linker memory default setting:
https://learn.microsoft.com/en-us/cpp/b ... w=msvc-170
That's deep. You do all the hard work, so I don't have to... it's appreciated
- It was too lonely at the top.
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Re: PB 6.10 beta 5 #PB_Any return value type changed?
Just noticed that in Windows 7 x64 with this beta the behaviour is to return small numbers like in previous PB versions, they actually fit in a long type.
This different memory behaviour between os with the same PB version can cause problems in some situations.
This different memory behaviour between os with the same PB version can cause problems in some situations.
Re: PB 6.10 beta 5 #PB_Any return value type changed?
Why? What kind of situation?Justin wrote: Sat Feb 10, 2024 1:25 pm This different memory behaviour between os with the same PB version can cause problems in some situations.
It doesn't matter whether a memory location is large or small, as long as you use the correct variable type: Integer.
I know, old codes here in the forum uses sometimes Long, because they where used in older PB version before the type integer was introduced. These codes should be avoided or adapted.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module


