Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!asuvax!ncar!unmvax!uokmax!servalan!epmooch!ben From: ben@epmooch.UUCP (Rev. Ben A. Mesander) Newsgroups: comp.sys.amiga.programmer Subject: Re: SAS C Stack Question Message-ID: Date: 15 Apr 91 10:44:17 GMT References: <2858@sirius.ucs.adelaide.edu.au> <1991Apr15.234658.21860@uservx.afwl.af.mil> Lines: 21 >In article <1991Apr15.234658.21860@uservx.afwl.af.mil> galetti@uservx.afwl.af.mil writes: [...] >I probably missed this in a previous discussion, so I apologize if it's a >redundant question, but how do you know how much stack space a particular >program needs in SAS C? I just wrote a program that has six 100-element >integer arrays and it bombed with 8000 bytes of stack space. 10,000 bytes >seemed to be enough, but man I hate playing guessing games. How much >space does a program need, and how do you tell how much it needs? Well, for starters 6 * 4 * 100 = 2400, but you need space for everything else also.. I always declare large arrays static so that they do not go on the stack. Usually there's no compelling reason to make large arrays automatic. This really helps save stack space. >-Ralph -- | ben@epmooch.UUCP (Ben Mesander) | "Cash is more important than | | ben%servalan.UUCP@uokmax.ecn.uoknor.edu | your mother." - Al Shugart, | | !chinet!uokmax!servalan!epmooch!ben | CEO, Seagate Technologies |