home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!crdgw1!newsun!damurphy
- From: damurphy@wc.novell.com (Duane A Murphy)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: How to increase stack size ???
- Message-ID: <1992Sep3.180837.8540@novell.com>
- Date: 3 Sep 92 18:08:37 GMT
- References: <1992Sep1.145611.1@uwovax.uwo.ca> <1992Sep2.154822.12924@novell.com> <71922@apple.Apple.COM>
- Sender: usenet@novell.com (The Netnews Manager)
- Organization: Novell, Inc. - Walnut Creek
- Lines: 35
- Nntp-Posting-Host: optics
-
- In article <71922@apple.Apple.COM> grobbins@Apple.COM (Grobbins) writes:
- >
- > // Increase the space allocated for the application stack
- > //
- > // Warning: SetApplLimit always sets the stack to at least as large as the
- > // default stack for the machine (8K on machines with original QuickDraw,
- > // 24K on machines with Color QuickDraw) so the application partition
- > // must be large enough to accomodate an appropriate stack and heap
- >
- > OSErr IncreaseApplicationStack(Size incrementSize)
- > {
- > OSErr retCode;
- >
- > // increase the stack size by lowering the heap limit
- > SetApplLimit((Ptr) ((unsigned long) GetApplLimit() - incrementSize));
- > retCode = MemError();
- > if (retCode == noErr) MaxApplZone();
- >
- > return retCode;
- > }
- >
- >Do heed the warning given in the comment. All stack allocation beyond
- >the default must be compensated for by increasing the partition size in
- >the SIZE -1 resource.
- >
-
- Be forwarned to test this on many machines (namely an SE or other 68000
- based machine). I believe I tried this; it may have even been one of
- my first attempts. I think this works but is it what is desired?
-
- This increases the stack size by an amount. It does not _SET_ the stack
- size. I needed (as I believe the original author did) to set the
- stack size to a particular size.
-
- ...Duane
-