Hello all,
 I am hoping that there are others out there with some of the same issues
that I have when it comes to digesting the PalmOS Companion and Resource
guide (THEY).  I am primarily focusing on the PalmOS architecture and memory
management (from an applications point of view).  There are several
questions that I have:



1)       They mention "globals" for an application being loaded into dynamic
memory based on the launch code for the application.  What exactly do they
mean by "globals"?

Microsoft uses the terms, Lifetime (the period during execution of a program
in which a variable or function exist) and Scope, a.k.a. Visibility (the
portion of the program in which an identifier can be referenced) when
talking about "global" identifiers.

In the context of Lifetime, identifiers with the storage-class-specifier of
'static' or that are declared at the external level always have "global" or
'static' lifetimes (storage and defined value (with static-class-specifier)
for the duration of the program).  Else, the identifier is 'automatic' with
a 'local' lifetime.

In the context of scope and visibility, there are four categories (which I
will not go into for that sake of keeping this as short as I can); File
scope, Function scope, Block scope, and Function-prototype scope.  The scope
of File scope identifiers (also know as 'global' or 'external') begins at
the point of its declaration or definition and terminates at the end of the
translation unit.

With all of that in mind, what is the PalmOS documentation referring to when
they mention the loading of (or lack there of) globals into dynamic memory?
Is it in the context of Lifetime globals or Scope and Visibility globals?



2)      They make several references to sub-launching an application, yet
they never really define what "sub-launching" means in reference to memory
allocation other then 'globals' (please refer to the above question) are not
loaded into dynamic memory.  This is somewhat confusing to me.

In the multitasking world, when an application is loaded into memory, its
code segment (cs1) is loaded and then one instance of its data segment (ds1)
is loaded.  If the application is launched again, another data segment (ds2)
is allocated and loaded into memory that will use the same code segment
(cs1).  If a different application is launched, a new code segment (cs2) is
allocated as well as a new data segment (ds3) that will reference cs2.

So how does the PalmOS handle this (lets leave multi-segment applications
out of the mix for now)?

I know that you cannot launch the same application twice in the PalmOS
environment.  Therefore, you will never have the same application with two
data segments using the same code segment.  But, if I 'sub-launch' an
application (i.e. use the palmcall URL to cause Clipper to sub launch
another application (app1) with the SysAppLaunch routine) how is the memory
allocation handled?  Does app1 share the data segment of the clipper
application, or is there a new code and data segment created for app1?



 Any assistance or reference to additional reading material is greatly
appreciated.

 Thanks in advance,

Chad Smith




-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to