home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 6759 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.3 KB

  1. Path: news.tau.ac.il!usenet
  2. From: "Avi L." <avil@sapiens.com>
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Dynamic loading/linking
  5. Date: Tue, 02 Apr 1996 13:25:01 +0200
  6. Organization: Sapiens Tech.
  7. Message-ID: <31610E8D.23C6@sapiens.com>
  8. References: <Dp0x52.90C.0.-s@cs.vu.nl>
  9. NNTP-Posting-Host: honda.sapiens.co.il
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01 (WinNT; I)
  14.  
  15. Irmen de Jong wrote:
  16.  
  17. > What solutions  are feasible?
  18. > - Overlay. Don't know how this works. Can overlays reference global
  19. >   data? YES.
  20.  
  21. Can overlays be loaded without replacing other parts of the
  22. >   program? YES, as long as the overlay module is separate from the main program.
  23.  
  24. Can overlays be constructed without a great deal of work
  25. >   required by the programmer (yea, that's right, me)?
  26.  
  27. NO, they have a few restrictions which can make life diffilcult for ya and you still
  28. can't reference global data. see answer 2.
  29.  
  30. > - Amiga shared library. Would be most ideal, but libraries cannot reference
  31. >   global data. (Ok Ok they can by passing all the pointers to all the
  32. >   global data you want to reference but in my case this is no option.
  33. >   Way to much global data.)
  34.  
  35. yes, it's a sore point about the amiga OS. no dynamic linking is indeed a problem but
  36. you can pack the globals into a structure and pass that structure's address to the library.
  37. you'll have to create macros with the names of the of your globals that access the structure
  38. instead of the stand-alone variables. that way you'll save yourself alot of compilation pain.
  39. it does require a little work but i would recommend it
  40. since you don't have any other choice, unless you wanna stick with one 
  41. large program.
  42.  
  43. > - Dynamic loading with LoadSeg(). Can't reference global data, can I?
  44.  
  45. No you can't unless you wanna use addresses instead of variable names.
  46. i don't think you wanna do that though, so it's out of the question.
  47. best way (and the only one for now) is to use method 2 (ie libraries).
  48.  
  49. > *sigh* I thought it wasn't necessary but now I think the Amiga should have
  50. > some sort of dynamic linking support. AmigaDOS 4.0?
  51.  
  52. it isn't necessary since 'dynamic linking' exists for the functions and method 2 
  53. can easily be used to circumvent any problems regarding globals.
  54.  
  55. Avi Lev.
  56.