Most C compilers allocate local function variables on the stack
or just keep them in registers if they have little enough lifespan.
Static locals and globals go in the dynamic heap. One method to
not eat up lots of stack with large local arrays is to use pointers
instead of the actual arrays as the subroutines local variables, and
allocate and deallocate (carefully) on subroutine entry and exit.
This still uses memory, but in the heap instead of on the more
limited process stack. You lose automatic deallocation on exit,
so this can be a source of memory leaks though.
Ron Nicholson
HotPaw
http://www.hotpaw.com/rhn/hotpaw/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html