Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!agate!spam!lippin From: lippin@spam.berkeley.edu (The Apathist) Newsgroups: comp.sys.mac.programmer Subject: Re: Segmentation (was Re: ARRGH (Strings and things)) Message-ID: <1989Nov2.221738.4756@agate.berkeley.edu> Date: 2 Nov 89 22:17:38 GMT References: <16004@netnews.upenn.edu> <8835@hoptoad.uucp> <16420@dartvax.Dartmouth.EDU> <8852@hoptoad.uucp> <14386@well.UUCP> <8878@hoptoad.uucp> <1989Nov2.053139.23967@agate.berkeley.edu> <3813@sbcs.sunysb.edu> Sender: usenet@agate.berkeley.edu (USENET Administrator;;;;ZU44) Reply-To: lippin@math.berkeley.edu Organization: Authorized Service, Incorporated Lines: 28 Recently vallon@sblw.UUCP (Justin Vallon) wrote: >Remember that when _LoadSeg is called, ALL jt entries that reference that >segment are updated to a single JMP to the address of the routine in the >locked code segment. Since you never UnloadSeg(main-seg), these jt entries >will never require a LoadSeg, or A5 to get to your routine in the always- >loaded main segment. This is true, but misses the point. It would be quite an inconvenience to put all routines that are referenced by pointers into the main segment. However, this isn't necessary -- even when a segment is unloaded, a pointer into the jump table is still valid. Jumping at it will cause the segment to be loaded. As has already been pointed out, this would be a problem at interrupt time, so one must avoid unloading code (and, for that matter, other resources) that will be needed during pending interrupts. I seem also to have caused some confusion in my statement that "a true Jedi's development system will use pointers into the jump table." I did not mean to imply that this was a Rare and Special Thing, but rather that the most common ones do, but I'd check first when using a more obscure system. --Tom Lippincott lippin@math.berkeley.edu "Those who understand will require no further explanation." --Saul Bellow