Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!apple!keith From: keith@Apple.COM (Keith Rollin) Newsgroups: comp.sys.mac.programmer Subject: Re: TRAP BUG? In SetGrowZone() Message-ID: <47202@apple.Apple.COM> Date: 8 Dec 90 01:01:24 GMT References: <1CE00001.66qcvx@tbomb.ice.com> Organization: Apple Computer Inc., Cupertino, CA Lines: 41 In article <1CE00001.66qcvx@tbomb.ice.com> time@tbomb.ice.com writes: > >In article <1990Dec6.204708.15592@svc.portal.com>, daven@svc.portal.com writes: >> In C or Pascal, SetGrowZone() is a procedure, not a function. It does >> not return anything. We've been using SetGrowZone() for years and it >> has worked just fine for us - but then again we don't test for a >> return value. > >Thanks, that is the correct answer. > >I am implementing the trap call in Assembler, and Inside Mac Vol II >page 42 clearly states that d0 returns a result code. However, I did >not make the logical leap to see that the Pascal call (shown just >above the assembler comment :) was a procedure. > >I starting trapping applications, and all of them ignored the return >code. This is when I realized the answer that you gave. Gotta take >that bible with a grain of salt some times. I actually think that there is still something a little goofy going on. Almost ALL Memory Manager and OS routines return a result in D0. I think that the only excections for the Memory Manager are SetHandleSize and SetPtrSize. However, this result is never returned directly to the application. Instead, you are supposed to query MemError for the result code. It is D0 that gets stuffed into MemError. However, I don't think that anyone really expects SetGrowZone to return an error (IM says that the only result code is noErr), and so never check, which is why no one else is running into the problem you are. Hmmm...that's an interesting quesion: Does MemError hold the same value as D0 after SetGrowZone? If not, then that means that something happened to D0 between the time SetGrowZone completed and the time your application regained control. That in turn will indicate if it is indeed a patch that is munging D0. -- ------------------------------------------------------------------------------ Keith Rollin --- Apple Computer, Inc. --- Developer Technical Support INTERNET: keith@apple.com UUCP: {decwrl, hoptoad, nsc, sun, amdahl}!apple!keith "Argue for your Apple, and sure enough, it's yours" - Keith Rollin, Contusions