load-foreign-library behaviour

Madhu enometh at meer.net
Mon May 16 09:47:23 UTC 2022


LOAD-FOREIGN-LIBRARY and USE-FOREIGN-LIBRARY have the undesirable
side-effect of closing the library first before loading it. While
unloading doesn't seem to work on ccl, on Lispworks, mkcl and ecl this
actually does what is intended, but it has unfortunate consequences
with some libraries which perform initializations which are not undone
when they are unloaded. reloading the library is disastrous.

the names LOAD-FOREIGN and USE-FOREIGN have nothing to suggest there
is unloading involved.  The expectation is that unloaded libraries are
loaded. If a library is already loaded there is no expectation that it
will be touched.  This is the desired behaviour.

In my case I have been bitten by USE-FOREIGN-LIBRARY and I changed it
to not unload with the following patch. Can anyone suggest anything
better?

[Please don;t ask me to open a github issue, I've tried using the
github channels since 2019 absolutely no success]

-------------- next part --------------
A non-text attachment was scrubbed...
Name: use-foreign.patch
Type: text/x-patch
Size: 2298 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cffi-devel/attachments/20220516/e3c7462b/attachment.bin>


More information about the cffi-devel mailing list