Xref: utzoo comp.os.os2.programmer:499 comp.os.os2.misc:812 Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!unicorn!n8840371 From: n8840371@unicorn.cc.wwu.edu (Todd Crowe) Newsgroups: comp.os.os2.programmer,comp.os.os2.misc Subject: Re: How to figure out the amount of stack space? Message-ID: <1991Mar9.013432.11522@unicorn.cc.wwu.edu> Date: 9 Mar 91 01:34:32 GMT References: <1991Mar09.000303.21960@eecs.wsu.edu> Organization: Western Washington University, Bellingham WA. Lines: 26 (I was going to reply directly but other people might be interested as well.) In comp.os.os2.programmer wbonner@yoda.eecs.wwu.edu writes: >Does anyone have a utility program available that can tell me approx. how >much stack space I should have available for a program, given a set of source >code files? I think part of my problem right now is stack space, but I don't >know, and I can't really enable stack checking in a pm program. (I don't think >I can at least) Think about it. Your stack grows dynamically according to what happens in the program. The only way you can see how much stack you need is to monitor the size of the stack while the program is running. This won't/can't really even answer the question, though, because you still don't neccessarily know what you will need in the worst case. Yes, you can enable stack checking in a PM program. The reason that it is not recommended is that you the __chkstk routine outputs to stderr (I could be wrong, it might be stdout - but that wouldn't make much sense). In any case you can simply redirect output of the PM program to a file and any messages will show up there. This is a good way to debug PM programs in some cases and is easier than sending error codes specifically to a file. | Todd Crowe | | n8840371@unicorn.wwu.edu or TODDC@nessie.wwu.edu | There are three types of people, those who can count and those who can't.