On Fri, 22 Jun 2012 22:58:13 +0200
Juan Jose Garcia-Ripoll <juanjose.garciarip...@googlemail.com> wrote:

> On Fri, Jun 22, 2012 at 1:06 PM, Stanislav Frolov 
> <frolosof...@gmail.com>wrote:
> 
> > Thank you, Matt! I just miss finalization section in the ECL manual.
> 
> 
> I am sorry: the references had disappeared almost entirely due to an
> upgrade of the manual to support Docbook 5.0. If you go back to
> http://ecls.sourceforge.net/new-manual/ you will find again the manual
> pages for ext:get-finalizer and ext:set-finalizer.
> 
> One word of warning, though: finalization has a penalty which is not to be
> ignored. A more performant option might be to have a custom "new" method
> that uses the garbage collector as memory manager. I believe the
> Boehm-Weiser library has examples on how to combine C++ and its collector.

Good to know, I had once read that finalization was costly on SBCL but
thought it was SBCL-specific.  But indeed the manual seems clear about
this problem, now that I looked...

Using the GC-friendly malloc-like primitives?  I guess that is only
possible when we control the library though, rather than obtaining a
pointer from it via FFI?

Another interesting thing to consider is Common Lisp's UNWIND-PROTECT
capability, which can be used with a clean WITH macro to avoid
forgetting to explicitely free/destroy an FFI-pointed object and/or OS
resource, just like WITH-OPEN-FILE, etc...
-- 
Matt

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list

Reply via email to