Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!nysernic!itsgw!steinmetz!uunet!nuchat!sugar!karl From: karl@sugar.UUCP Newsgroups: comp.sys.amiga Subject: Re: Dynamic Stack Allocation Message-ID: <958@sugar.UUCP> Date: Sat, 31-Oct-87 23:30:53 EST Article-I.D.: sugar.958 Posted: Sat Oct 31 23:30:53 1987 Date-Received: Tue, 3-Nov-87 06:23:09 EST References: <4585@zen.berkeley.edu> Organization: Sugar Land UNIX - Houston, TX Lines: 14 Summary: don't use the stack In article <4585@zen.berkeley.edu>, c164-1bj@cordelia.berkeley.edu (Jonathan Dubman) writes: > .... it needs a large stack. Maximum resolution requires about 150K of > stack space. (Massive recursion.) I don't want everybody who runs it without > reading the docs first to crash their machine. Most of the responses so far have been hacks for increasing the amount of stack space. Why not malloc the space and handle your recursive data yourself, managing your data frames explicitly by incrementing and decrementing an index on entry and exit of your recursive routine? (With this method, by the way, one can write recursive programs in BASIC.) Note that I'm assuming you're putting pretty much stuff on the stack each pass. If you needed 150K depth for a little frame but super deep recursion, this wouldn't gain much, if anything. --