I've rewritten the RTL so Felix dynamic libs and their
instances are now garbage collected. A library instance
is the library together with a thread frame object (global store).
The instance is actually only needed transiently if at all,
since any running procedure using the thread frame
refers to it: hanging on the thread frame via the instance
is probably an issue, however in general a library such
as a plugin can have other entry points, and these are
coupled with the instance.

Anyhow, with the new method, libraries do NOT get unloaded
when there are no references to them because this is entirely
unsafe in C++ and very nasty to manage in C.  Bad languages
lead to nasty problems. Any pointer into the library such as
a vtable pointer or C string requires the code remain resident
and there's no reliable way to track this.

However there's a new problem created by this: the objects holding
the library and instance are not themselves tracked. These are the
very top level objects, the felix "world" objects. This is fine if they're
on the stack, since the stack is scanned conservatively, provided the
threads base stack pointer is obtained before creating the world
object.

however if these objects get heaped .. they will have to be garbage 
collected too. Since the whole idea is to get rid of the need to
root and unroot the instances, since unrooting them requires
action under program control which is hard to do.

I may have to actually "destroy" thread frames in instances artificially
by nulling out the pointers since the whole idea of an instance
is to exist even when the libraries entry points are not active,
for example entry points could be executed by callbacks from 
foreign event loops.

--
john skaller
skal...@users.sourceforge.net
http://felix-lang.org




------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to