help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: dynamic reload of dynamic module not dynamic?


From: Philipp Stephani
Subject: Re: dynamic reload of dynamic module not dynamic?
Date: Tue, 19 Apr 2022 14:46:52 +0200

Am Mo., 18. Apr. 2022 um 23:07 Uhr schrieb Emanuel Berg via Users list
for the GNU Emacs text editor <help-gnu-emacs@gnu.org>:
>
> Philipp Stephani wrote:
>
> >> It seems recompiling the C for an Emacs dynamic module and
> >> then loading the new SO file from the same Emacs instance
> >> that loaded the old doesn't get you the new stuff?
> >
> > Yeah, we never call dlclose on the returned shared object
> > handle, so reloading a module will only increment the
> > handle's reference count. It might make sense to support
> > reloading in some way (by having unload-feature eventually
> > call dlclose), but it's not trivial: we need to be careful
> > to invalidate all references to affected module functions
> > before calling dlclose.
>
> Okay, where are they stored then so one can apply invalidate
> to all members and then call dlclose and `load' again?

I don't think we have a single exhaustive location, but at the very
least we'd need to invalidate all corresponding module functions
before unloading a module, probably repointing them to some function
that always signals an error. There is no mapping from module handles
to corresponding module functions yet, but it shouldn't be terribly
hard to add one (but I think first we should discuss whether the FR is
important enough for that). Another category would be user pointers,
since they are likely to point nowhere once a module gets unloaded.



reply via email to

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