Article View: comp.sys.mac
Article #24676Re: stack sniffer evils
From: Charlie C. Kim
Date: Thu, 04 Feb 1988 01:24
Date: Thu, 04 Feb 1988 01:24
30 lines
1529 bytes
1529 bytes
You can disable the stack sniffer with the following Pascal code:
PROCEDURE DisableStackSniffer;
CONST StkLowPt = $110; { system global }
TYPE LongPtr = ^LongInt;
VAR p : LongPtr;
BEGIN
p := longptr(StkLowPt);
p^ := 0;
END;
(makes you appreciate C).
StkLowPt is documented someplace in Inside Macintosh, but I forget
where... StkLowPt is the point that the sniffer decides that the
stack has gone too far.
All this aside, be very careful. Some toolbox routines may assume
that the space between the bottom of the stack and the top of the
application heap is fair game to do with as it pleases--and it does.
I believe its mainly some quickdraw routines that do this, but others
may too. This might have been changed with the Multifinder release of
the system, but I doubt it.
I think is that it is better to avoid the entire problem of having
multiple stacks: whether it be on the heap or by splitting up the
stack area. Very strange things can happen when you do.
Charlie C. Kim
User Services
Columbia University
Technical Details
Message-ID:
<418@cunixc.columbia.edu>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bbn!rochester!udel!princeton!rutgers!columbia!cunixc!cckReferences:
<363@moncsbruce.oz>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bbn!rochester!udel!princeton!rutgers!columbia!cunixc!cck From: cck@cunixc.columbia.edu (Charlie C. Kim) Newsgroups: comp.sys.mac Subject: Re: stack sniffer evils Message-ID: <418@cunixc.columbia.edu> Date: 4 Feb 88 01:24:03 GMT References: <363@moncsbruce.oz> Reply-To: cck@cunixc.columbia.edu (Charlie C. Kim) Organization: Columbia University Lines: 30 Keywords: mac programming, lightweight processes, SysError()