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: <1992Sep4.160059.29329@novell.com>
- Date: 4 Sep 92 16:00:59 GMT
- References: <1992Sep2.154822.12924@novell.com> <2AA522C1.F27@deneva.sdd.trw.com> <PHILS.92Sep4090350@chaos.cs.brandeis.edu>
- Sender: news@novell.com (The Netnews Manager)
- Organization: Novell, Inc. - Walnut Creek
- Lines: 33
- Nntp-Posting-Host: optics
-
- In article <PHILS.92Sep4090350@chaos.cs.brandeis.edu> phils@chaos.cs.brandeis.edu (Phil Shapiro) writes:
- >>>>>> On Wed, 2 Sep 92 20:23:29 GMT, buckeye@spf.trw.com (John Wallace) said:
- >
- > > if (StackSpace() < STACK_MIN)
- > > SetApplLimit(StackPtr() - (STACK_MIN - StackSpace()))
- >
- > > This will make sure that you don't waste too much memory on "Large"
- > > machines. (StackSpace is a standard Toolbox trap.)
- >
- >This is the best solution, but... On 68000 machines, the trap
- >StackSpace() returns garbage unless you've already called
- >MaxApplZone() (in which case the call to SetApplLimit will fail). I'm
- >not sure, but this may have been fixed in System 7.
- >
- >In any event, I would recommend using the low memory global DefltStack
- >instead. In THINK C, you can just write:
- >
- > SetApplLimit(GetApplLimit() - (STACK_NEEDED - DefltStack));
- ...
-
- Thank you for jogging my memory. This is the problem that I ran into.
- Once MaxApplZone is called adjusting the stack space larger will
- cross into the heap space simulating a stack heap collision. That is
- why it was necassary to adjust the stack size at the start as opposed
- to dynamically at run time. (I think this sounds rights).
-
- How can one adjust the stack size dynamically (as recommended by DTS)
- when it simulates moving the stack into the heap?
-
- No it is not fixed on System 7. In fact StackSpace() works differently on
- different models with the _SAME_ system! This was very confusing.
-
- ...Duane
-