"D. DeVecchio" <[EMAIL PROTECTED]> wrote in message
news:9088@palm-dev-forum...
>
> I am having trouble overflowing the stack.
>
> How big is the stack?
According to the PalmOS Programmer's Companion in the SDK 3.5 docs (pp.
144-145), you have 4K of stack for PalmOS 3.0 and later devices, and only
2.5K for older versions of the OS.
> Pilot main is called by the OS.
> This function calls a "normal launch" function which calls a third
> function which calls a 4th and a 5th. the last three functions can open
> forms, but I never pass large data structures - only pointers.
Each pointer will be 4 bytes, plus the function return address -- another 4
bytes. I think your stack is probably being consumed by local variables.
If you have any arrays or structures declared in your functions, those
consume stack space too. It would be better for you to grab a handle in the
dynamic heap or allocate as global variables any large items you use.
Is this only occuring the in the debug (non-optimized) version of your
application? Both GCC and CodeWarrior will allocate variables on the stack
in debug mode that would otherwise live in registers and not take stack
space.
If your on a PalmOS 3.0 or later device, you could call SysGetStackInfo to
find out what the bounds of the stack are, then use that info to find out
how much stack you've used (taking the address of a local variable will give
you the approximate address of the stack pointer).
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html