Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!mips!swrinde!elroy.jpl.nasa.gov!ncar!unmvax!uservx.afwl.af.mil!galetti From: galetti@uservx.afwl.af.mil Newsgroups: comp.sys.amiga.programmer Subject: Re: SAS C Stack Question Message-ID: <1991Apr15.234658.21860@uservx.afwl.af.mil> Date: 15 Apr 91 23:46:58 GMT References: <2858@sirius.ucs.adelaide.edu.au> Organization: Phillips Laboratory - Kirtland AFB Lines: 41 In article <2858@sirius.ucs.adelaide.edu.au>, jpotter@ucs.adelaide.edu.au (Jonathan Potter) writes: > In article lordbah@amusing.uucp (Jeff Van Epps) writes: >>I have a program which runs in the foreground, doing I/O to the console >>it was started from. How can I guarantee from within the code that the >>program gets started with a stack >= some given size? The manuals give >>an example for linking with (cres.o or cback.o, forget which), but this >>program runs in foreground and is currently not eligible for resident. >> >>-------------------------------------------------------------------- >> Jeff Van Epps uunet!amusing!lordbah > > I know its not exactly what you want, but you could just CHECK to see that you > had enough stack, and if not, abort with an error message. To do this : > > struct Process *myproc; > > myproc=(struct Process *)FindTask(0); > if (myproc->pr_StackSize > > Jon > -- 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? -Ralph > | Jonathan Potter | | Life is like a piece of | > | P.O. Box 289 | jpotter@itd.adelaide.edu.au | spinach... | > | Goodwood, SA | FidoNet : 3:680/829 | | > | Australia 5034 | | Sort of green and wrinkly | ___________________________________________________________________________ / Ralph Galetti Internet: galetti@uservx.afwl.af.mil \ | PL/LITT Interests: computers, music, computers | | Kirtland AFB, NM 87117-6008 and music, golf, sleep. | \__"No, they couldn't actually prove that it was HIS vomit" - Nigel Tufnel__/