Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!iuvax!purdue!mentor.cc.purdue.edu!ain From: ain@mentor.cc.purdue.edu (Pat-bob White) Newsgroups: comp.sys.amiga Subject: Re: stack Message-ID: <3634@mentor.cc.purdue.edu> Date: 11 Aug 89 18:32:45 GMT References: <16943@ut-emx.UUCP> Reply-To: ain@mentor.cc.purdue.edu (Pat-bob White) Organization: PUCC Land, USA Lines: 25 In article <16943@ut-emx.UUCP> sjk@ut-emx.UUCP (sjk) writes: >I have written a couple of programs which seem to require large >stacks in which to run, so I have two questions: >1) How can I tell just how large a stack a given program will > need? Or is it all just trial and error? I asked this of the authors of Manx & Lattice C at an Amiexpo two years ago and got a response pretty much like "you just have to guess". Seems to me that one could pretty easily ask where the stack is at the beginning of a function call.. but then one must select input to drive the program to use the maximum amount of stack. >2) What do I lose by always runnig with a larger stack so I don't > run my programs, forgetting to change the stack, and wind up > visiting meditation heaven? A separate stack is allocated for every program while it runs -- if you run them with more stack then they need, you have less memory to use while they are running. hope this helps, Pat White ARPA/UUCP: j.cc.purdue.edu!ain BITNET: PATWHITE@PURCCVM PHONE: (317) 743-8421 U.S. Mail: 320 Brown St. apt. 406, West Lafayette, IN 47906 Life is a joke.. so laugh at it :-)