Prior to OS 3.0, the stack space was fixed at about 2.5 KB. For OS 3.0 and beyond, an application can provide a resource specifying a desired stack size. If no such resource is defined, the default stack size is 4 KB.
Keep in mind that stack space is used by all of the following:
Your application code directly
The OS, whenever you call an OS routine
Other applications when called by the OS (e.g., during a Find, a Beam Receive, or an Alarm)
For those launch codes where the OS provides a new stack to an
does so by allocating a nonrelocatable memory block, and setting up
the processor’s stack pointer to the last
byte of that memory block. On
the processors currently used by the Palm OS, the stack grows
down (as items are pushed on the stack, the
stack pointer points to lower memory addresses).
In order to specify a stack size other than the default, you’ll
need a `
pref' resource, with ID 0. The
resource consists of the following:
A 2-byte integer specifying the priority of this application. It is currently unused, but you should set it to 30.
A 4-byte desired stack size (in bytes). The default, if you
don’t provide a stack size is
KB) for OS 3.0 to OS 3.3, and 3.5 KB for OS 3.5 and OS 4.0.
A 4-byte minimum heap size necessary for this application to run. It
is currently unused, but you should set it to
0x1000 (4 KB).
There is a single API that returns information about ...