[Top][All Lists]

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

Re: Module unloading

From: Neil Jerram
Subject: Re: Module unloading
Date: Thu, 26 May 2005 19:43:14 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Debian/1.7.8-1

Rob Browning wrote:

This made me wonder -- what happens if you dynamically load (dlopen) a
lib that depends on libguile, and then you later dlclose that lib?
What happens to libguile?  Presumably it will be unloaded too.  Does
Guile tolerate that?

If so, does Guile tolerate being re-loaded?  For example if you then
re-dlopen the lib that depends on libguile and start using it?

What happens "inside" the library when it is dlopened? I thought nothing, so I doubt that loading and unloading per se would be a problem.

If a single program called scm_init_guile() twice without the library being unloaded and reloaded first ... I doubt the code would handle that, but I'd say this is incorrect use of the API.

If a single program calls scm_init_guile(), later unloads libguile, the reloads libguile and calls scm_init_guile() ... I'd say this _ought_ to work, and it probably mostly does as long as reloading reinitializes libguile's global data. Since there is no scm_term_guile(), though, I suspect we would also have leaked a lot of memory on the heap.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]