Paul Reger wrote:
What is the stack size on palm? Is there any help for debugging stack
over flow problems in palm? Such as what is the current stack size?
At runtime, you can use SysGetStackInfo() to get three pieces of
information:
* the start of the stack
* the end of the stack
* a flag that tells you whether the OS has ever detected
that the stack has overflowed (since app launch, I think)
I'm not sure if the "start" of the stack means the start of the
area region that contains the stack (which would be fixed) or
means the current stack pointer value. Presumably, it means the
latter. In which case, call SysGetStackInfo() at the start of
the app and compute start - end to get the actual stack size,
then call it later and compute start - end again to find the
amount remaining (or originalstart - currentstart to get the
current usage).
Another thing you can do is run under the Emulator, which will
give you warnings as the stack starts to fill up.
A third thing you have control over is the stack size, via the
'pref' resource in your app's PRC. Constructor lets you set
the stack size using this, and presumably so do other development
tools. In Constructor, the setting is in the same little section
that that lets you set the icon name, version string, etc.
According to the Constructor documentation[1], increasing the 'pref'
stack size will take away memory from the dynamic heap (just like
globals do), so keep that in mind when increasing it. The same
documentation also says the default stack size is 3.25K.
- Logan
[1] http://www.palmos.com/dev/support/docs/constructor/CGR_Basics.html#996431
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/