I stand corrected by he-who-knows-all! :)
(My only excuse for the error: I was just thinking about A5 not pointing to
anything meaningful, without thinking one step further -- that there was
nothing meaningful to point to. :( )
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of David
> Fedor
> Sent: Friday, April 20, 2001 11:43 AM
> To: Palm Developer Forum
> Subject: RE: Global Variables and sysAppLaunchCmdSystemLock
>
>
> >(aside: you can probably always access global vars if you can figure out
> >where they are, but that is another matter entirely, and I'm sure any
> >attempt to do so will break in future OS versions.)
>
> Not really - they aren't anywhere, so you wouldn't be able to find them.
> When your app isn't running (and when it is running but globals haven't
> been created), there's no memory anywhere that stores those globals. The
> whole point of not setting up the globals world was to save time
> and memory
> on little launchcodes which hardly ever needed them.
>
> Think of how the compiler does things: to access a global variable, it
> takes register A5 and adds an offset, and uses that as the location of the
> global variable. Now when globals are being set up, what this means is
> that the system allocates a bunch of memory, initializes it, and points A5
> to it. And then when your app quits, it frees that memory block. So when
> you don't have globals available, it isn't that we're sadistically hiding
> them; instead they simply don't exist!
>
> And yes, this sort of thing will certainly change in newer OS releases.
>
> -David Fedor
> Palm Developer Support
>
> --
> For information on using the Palm Developer Forums, or to
> unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/