On Thu, 13 Jun 2013 10:30:33 +0900
Dietrich Bollmann <dietr...@formgames.org> wrote:

> CLOS relies on a garbage collector to destruct objects which are not
> referenced anymore, so no explicit destructor method is foreseen.
> 
> However, when wrapping a C++ class into a CLOS class, the destructor of the
> C++ object has to be called when the CLOS object is garbage collected to
> free the foreign object.
> 
> Is there a way to hook into the CLOS object destruction process initiated
> by the garbage collector in order to call the C++ destructor when the CLOS
> object is garbage collected?

It is possible to register finalizers, although they may only execute
when the GC actually discards the objects, thus it cannot execute
predictably (see http://ecls.sourceforge.net/new-manual/ch28s05.html).

If you need more performance and predictability, you may want to
provide some WITH-* style macros internally using UNWIND-PROTECT as well
-- 
Matt

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to