Path: 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() 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