home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!uwm.edu!biosci!agate!eos!data.nas.nasa.gov!taligent!kip-15.taligent.com!user
- From: keith@taligent.com (Keith Rollin)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Pointers to function and UnloadSeg
- Message-ID: <keith-231192142230@kip-15.taligent.com>
- Date: 23 Nov 92 22:24:41 GMT
- References: <1992Nov23.002629.3444@ccu1.aukuni.ac.nz>
- Sender: usenet@taligent.com (More Bytes Than You Can Read)
- Followup-To: comp.sys.mac.programmer
- Organization: Taligent
- Lines: 18
-
- In article <1992Nov23.002629.3444@ccu1.aukuni.ac.nz>,
- russells@ccu1.aukuni.ac.nz (Russell Street) wrote:
- >
- > What steps should I take to ensure that when I use pointers to functions
- > in CODE segments that I (may) unload later? This is in Think C 5.
-
- You don't have to take any steps. When you take the address of a function,
- you are given a pointer to a jump table entry. When you later try to jump
- to the function, if it is unloaded, you'll end up calling _LoadSeg. If the
- code segment is loaded, the indirection provided by the jump table will
- make sure you end up in the right place, even if the segment has moved.
-
- Don't worry. Be happy.
-
- -----
- Keith Rollin
- Phantom Programmer
- Taligent, Inc.
-