home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / mac / programm / 18842 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  1.2 KB

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