lua-users home
lua-l archive

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



El 08/12/2004, a las 9:23, Mike Pall escribió:

lib/loadlib.c:
- [...]
- Change registerlib() to take a memory pointer and a size argument.
  A single boxed pointer does not suffice for the Mac OS X (un)loader.
- Pass back a pointer to the copied memory area to freelib().

One of the comments in from "loadlib.c" in lua-5.0.2 in the LuaCheia CVS:

 /* According to Apple's documentation, we can destroy the object image
  * after linking it: although we instruct Dyld to do that, Dyld will
  * keep it in memory as long as it is linked in the executable (i.e:
  * until NSUnLinkModule() is called)
  */

(This came up when Apple released full documentation for Dyld when Panther was released). So, you could implement loadlib() and freelib() with only a single boxed pointer.

In loadlib():
 1. image = NSCreateObjectFileImageFromPath()
 2. module = NSLinkModule(image)
 3. NSDestroyObjectFileImage(image)

In freelib():
 1. Just NSUnlinkModule(module)

The module won't be unloaded until you call NSUnlinkModule(module).

Hope this little comment will simplify things a bit. Cheers,

-ap

Attachment: PGP.sig
Description: Mensaje firmado digitalmente