Ideas for runtime loading of shared libraries.

Jacob Carlborg doob at me.com
Fri Mar 8 01:09:33 PST 2013


On 2013-03-08 01:17, Walter Bright wrote:

> D doesn't guarantee that finalizers will run on GC allocated objects.
> Therefore, when unloading a dll:
>
> 1. run a gc collection
> 2. for all objects remaining on the heap
>         if they have a finalizer and that finalizer points into the dll
> code
>              mark them as not having a finalizer

Could we do something like I suggested in another post:

We could create a standard plugin interface in Phobos or druntime, 
something like:

interface Plugin
{
     void initialize ();
     void terminate ();
}

Every plugin should implement this directly or indirectly. "initialize" 
would be called just after the plugin is loaded and "terminate" would be 
called just before unloading.

The plugin would then have a possibility to cleanup after itself.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list