[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

VM vs shared libraries



IMHO shared libraries should have a higher priority than VM because:

	- Shared libraries save memory (less need for VM).
	- Shared libraries save hard disk space.
	- Shared libraries might save compilation time.
	- Shared libraries ease up program updating. There's
	  no need to download half the MiNTLibs along with
	  every MiNT program. Several programs can be updated
	  just by changing their library (I'm totally pissed off
	  as every damn program seems to need a recompilation
	  before it starts to behave properly).

Dynamically loaded/linked libraries would be nice but one can't get
everything. Here's 'The Amoeba Way' for using/doing shared libs:

	- On Amiga you'll only need to add library opening (loads the lib
	  if it's not in the memory, gets a base pointer to the function
	  jump table) and closing calls to your program and use the
	  functions as usual.
	- For this you'll need modified headers that will include an inline
	  jump according to the loaded jump table instead of the normal
	  function call (hence, quite GCC specific). Libs / programs
	  using them can't have mutual cross referenced (extern) globals
	  as the shared lib isn't linked. You could of course do the
	  globals with base-relative addressing and hand over the base
	  pointer with some special function.
	- Naturally libs have to be pc-relative. Hand-crafting the jump
	  tables would be a pain so a utility for this should be devised.

Description courtesy of a friend of mine.

	- Library opening/closing/purging would normally be done with
	  the (MiNT) kernel, which keeps count on how many clients
	  access the library.
	- Libraries are 'purged' from memory when memory gets low
	  and then in reverse priority (memory use, access times,
	  explicit priority values?) order. This is for keeping disk
	  accesses fewer. On MiNT we could for example use the fastload
	  bit to indicate that the lib should be kept in memory even
	  when there aren't any clients left.


	/ Eero /