Felix now has a pluggable object scanner in the GC.
>From the commit log:

Change the GC to use user supplied pointer scanner functions.

The implementation may be a bit slower for now, however
the "scan_by_offsets" function is now used for scanning
instead of builtin method. This function is used by the compiler
for finding pointer by offsets, however now we can slot in
any scanner we like.

This feature is required to allow Judy arrays to be used in Felix,
since pointers keys in Judy arrays are encoded, and since in JudyL
arrays any value which is a pointer is not reachable by normal
pointer chasing. Instead we have to actually use Judy functions
to find the pointers.

As an additional benefit, most STL containers allocated on the heap
can now be made scanable by instantiating a simple template,
which basically  just uses STL begin() end() functions to iterate
over all stored values.

This is an interesting case of polymorphism by delegation.
The data supplied to the value scanner must include enough
information to find the pointers in the contained values,
for example a standard gc_shape_t pointer.

We will also add a "scan_conservative" function soon.
A simple 0 pointer for the function should mean the
object is atomic and shouldn't be scanned (I didn't check this!).

I also note in passing a lot of data types are getting finalisers.
In fact, most Felix data structures do not require finalisation.
Applying finalisers is EXPENSIVE since they have to be put in a list
when sweeping, then executed, and then finally the object deleted.
Postulate that removing the finalisers in most cases will greatly
speed up the GC.

We will have to add a feature to Felix C++ binding technology
to allow the user to specify a scanner function.

Once we have this solid, we can look at copy/clone/init/assign
and other "value supporting" methods to add to the shape, so we
can eventually support run time type creation and manipulation.

--
john skaller
skal...@users.sourceforge.net





------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to