Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!bloom-beacon!eru!luth!sunic!tut!santra!kampi.hut.fi!jmunkki From: jmunkki@kampi.hut.fi (Juri Munkki) Newsgroups: comp.sys.mac.programmer Subject: Re: Tail patches Keywords: Patches, Tails, "The Right Thing To Do" Message-ID: <26596@santra.UUCP> Date: 11 Nov 89 09:37:56 GMT References: <1459@sequent.cs.qmc.ac.uk> <36250@apple.Apple.COM> <5056@internal.Apple.COM> <1989Nov7.212837.5146@oracle.com> Sender: news@santra.UUCP Reply-To: jmunkki@kampi.hut.fi (Juri Munkki) Organization: Helsinki University of Technology, Finland Lines: 31 Tail patching seems to be one of those subjects that pop up now and then. Most people seem to agree that Apple is doing a stupid thing with the come from patch method. In addition to making tail patching impossible, they make the system software much more fragile. About six months ago the net was fighting with Apple asking them to change the way they install patches. I even came up with a method that in my humble opinion would solve the whole problem from the point of view of developers who want to tail patch. The idea is to use a shadow dispatch table for those traps that are used for come from patching. Calling GetTrapAddress gives that address from the shadow table and calling SetTrapAddress changes the shadow dispatch table. The addresses in the old dispatch table always point to routines that use the come from method. The come from patch does it's processing and then directly jumps into the shadow dispatch table. The best thing would of course be to change the way apple patches those long routines, but since they have started doing something stupid, it is very unlikely that they will ever stop. I wonder how much come from patching slows down the system. Most traps that are used for come from processing are short utility traps. Perhaps the most annoying examples are FixMul, FixDiv, FixRound and SectRect. I recommend that you use your own versions of these routines, if you intend to do any time-critical processing. _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ | Juri Munkki jmunkki@hut.fi jmunkki@fingate.bitnet I Want Ne | | Helsinki University of Technology Computing Centre My Own XT | ^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^