> From: Michael S. Davis [mailto:[EMAIL PROTECTED]]
> It is my understanding that the dynamic heap is limited to something
> like 12-14K. Is that true? Is this where global variables reside?
It varies, depending on OS version, device RAM size, etc. And in current OS
versions, both your app's stack and its global variables happen to be
implemented as chunks in the system's dynamic heap (allocated before your
PilotMain gets called), but this fact is not supposed to be visible or
relevant to your application.
> It is also my understanding that the stack space is something like
> 4K. Is that true? Do local variables in subroutines reside in the
> stack or the dynamic heap?
Right, the stack is very small. Local variables always live on the stack.
That's not a Palm thing, it's a basic generic C/C++ thing.
> If there is a stack overflow, does the stack just expand into
> the global variable space?
Well it will expand into _something_ and likely cause badness, but the exact
type of memory it will trash isn't generally knowable. It's generally
safest to assume that it would overwrite some critical I/O registers that
will cause the device to catch fire, and program accordingly.
> If I created a global array that was 600 bytes and removed
> the 200 byte array from the function, would that relieve
> the problem or am I in the same fix?
That sounds like a solution that would work.
> If instead of the global array, I used the memory manager to allocate
> 600 bytes for the array, would that help?
Actually the memory footprint of your app wouldn't be too different. The
important thing is to not use so much stack space.
> Is memory that is allocated by the MemManager part of the
> dynamic heap?
Yes, that's exactly what the dynamic heap is.
-slj-
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html