Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pointer in Basic
#23
(07-18-2023, 10:11 PM)SMcNeill Wrote: It's all about what's most efficient, in general cases, for the OS to read/write data.  (Note that things like #pragma pack and such alters such behavior.)  Generally speaking, the OS is going to write data in 4-bytes (sectors if you want) on a 32-bit App and in 8-byte sectors on a 64-bit App.

>> NOTICE I SAID APP AND NOT OS!!  64-bit OSes will still pack 32-bit programs into 4-byte sectors, rather than 8-byte sectors, so everything defaults for compatibility reasons.  <<
And why does QB64 reserve the same variables for me on a 32-bit OS in a 32-bit APP? So always 8 bytes for each variable.
Shouldn't that be at least 4 bytes?

I don't quite get it.

QB64 would then have to reserve something else. And the gaps are never really filled. I've already declared umpteen variables and restarted the program. On a 64-bit as well as on a 32-bit OS. With a 32-bit app as well as with a 64-bit app of the same program.
And again and again I can observe the same thing in the memory viewer.

Do you have some example code that better illustrates that the memory behaves differently?

Because I can't reproduce it no matter what I do instead.

My Visual Studio C++ app works like you say. But somehow QB64 doesn't intend to do what you're telling me.

Don't get me wrong, I know what you're saying and how the memory should work. But somehow QB64 doesn't want to keep that ^^
Reply


Messages In This Thread
Pointer in Basic - by Kernelpanic - 07-16-2023, 09:57 PM
RE: Pointer in Basic - by bplus - 07-16-2023, 10:17 PM
RE: Pointer in Basic - by mnrvovrfc - 07-17-2023, 12:05 AM
RE: Pointer in Basic - by SagaraS - 07-17-2023, 12:17 AM
RE: Pointer in Basic - by OldMoses - 07-17-2023, 12:40 AM
RE: Pointer in Basic - by bplus - 07-17-2023, 01:00 AM
RE: Pointer in Basic - by a740g - 07-17-2023, 02:53 AM
RE: Pointer in Basic - by SpriggsySpriggs - 07-17-2023, 11:55 AM
RE: Pointer in Basic - by Kernelpanic - 07-17-2023, 07:04 PM
RE: Pointer in Basic - by SagaraS - 07-17-2023, 09:39 PM
RE: Pointer in Basic - by mnrvovrfc - 07-17-2023, 10:52 PM
RE: Pointer in Basic - by Kernelpanic - 07-18-2023, 12:17 AM
RE: Pointer in Basic - by SagaraS - 07-18-2023, 02:42 AM
RE: Pointer in Basic - by bplus - 07-18-2023, 12:39 PM
RE: Pointer in Basic - by SMcNeill - 07-18-2023, 04:13 PM
RE: Pointer in Basic - by Kernelpanic - 07-18-2023, 04:26 PM
RE: Pointer in Basic - by SMcNeill - 07-18-2023, 04:59 PM
RE: Pointer in Basic - by SagaraS - 07-18-2023, 04:49 PM
RE: Pointer in Basic - by SMcNeill - 07-18-2023, 05:04 PM
RE: Pointer in Basic - by mnrvovrfc - 07-18-2023, 08:15 PM
RE: Pointer in Basic - by SagaraS - 07-18-2023, 07:30 PM
RE: Pointer in Basic - by SMcNeill - 07-18-2023, 10:11 PM
RE: Pointer in Basic - by SagaraS - 07-19-2023, 10:27 AM
RE: Pointer in Basic - by SMcNeill - 07-19-2023, 01:42 PM
RE: Pointer in Basic - by DSMan195276 - 07-19-2023, 11:15 PM



Users browsing this thread: 3 Guest(s)