Thomas,

As Logan mentioned, running your application under the Palm OS Emulator will tell you when your application overflows the stack and (if possible) even when it's close to overflowing the stack. When you get such a message from the Emulator, it will include a partial stack trace, showing what functions are on the call stack and how much of the stack they are using.

It's my guess that one or two of those functions are taking up an inordinately large amount of stack space, and that reworking those one or two functions to dynamically allocate space from the heap instead of the stack will solve your problem. After all, with a 4K stack, if the average amount of stack space each function took was 40 bytes, you could stack up 100 function calls, which is not very likely the case. It's much more likely that one or two functions is taking 1K or more space on their own.

If you are using CodeWarrior, you can use #pragma warn_stack_usage in your source code to generate a list of functions that are using large amounts of stack.

-- Keith


On Dec 20, 2004, at 12:34 AM, Thomas Damme wrote:
thanks for all the responses. To clarify, whats the problem: I dont use any
recursion. Personally I dont like that.
What I/we have is some kind of a framework that abstracts many of the
palm-specific formhandling and -design. The application requires some
"levels" in the callstack, the framework itself too and the framework calls
a Table-function which also calls many sub-functions. And in one of these
calls, it overflows the stack.
So I have to increase the stack/function stack (if there is something like
that) or I will have to rewrite my application and the framework in order to
have as few functions as possible. But this could result in a bad design
since I'm proud to have a good one right now ;-)


"Thomas Damme" schrieb im Newsbeitrag news:[EMAIL PROTECTED]
does somebody know how I can increase the number of possible sub-calls of
functions?
By now one of my programs has too many of them since I use a special
framework that calls a Table-Function, which has many sub-calls too. The
program often crashes on very clean code-lines.
If nothing helps, I will have to rewrite my framework but I wanted to ask
if somebody has another solution..


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

Reply via email to