<div dir="ltr">Hi Matt,<div><br></div><div><div class="gmail_quote">On Thu, Jun 13, 2013 at 10:38 AM, Matthew Mondor <span dir="ltr"><<a href="mailto:mm_lists@pulsar-zone.net" target="_blank">mm_lists@pulsar-zone.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On Thu, 13 Jun 2013 10:30:33 +0900<br>
Dietrich Bollmann <<a href="mailto:dietrich@formgames.org">dietrich@formgames.org</a>> wrote:<br><br>> Is there a way to hook into the CLOS object destruction process initiated<br>> by the garbage collector in order to call the C++ destructor when the CLOS<br>
> object is garbage collected?<br><br></div></div>It is possible to register finalizers, although they may only execute<br>when the GC actually discards the objects, thus it cannot execute<br>predictably (see <a href="http://ecls.sourceforge.net/new-manual/ch28s05.html" target="_blank">http://ecls.sourceforge.net/new-manual/ch28s05.html</a>).<br>
</blockquote><div><br></div><div>Thank you very much for your answer!<br></div><div><br></div><div>And sorry for writing three unnecessary emails! I found your reply just now - after writing my second email :(</div></div>
</div><div style><br></div><div style>On Thu, Jun 13, 2013 at 10:38 AM, Matthew Mondor <span dir="ltr"><<a href="mailto:mm_lists@pulsar-zone.net" target="_blank">mm_lists@pulsar-zone.net</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
If you need more performance and predictability, you may want to<br>provide some WITH-* style macros internally using UNWIND-PROTECT as well<br></blockquote><div><br></div><div style>Thanks for this as well! </div><div style>
<br></div><div style>I will think about it - and thank you for providing this extra information which gives my question some sense at least :)</div><div style><br></div><div style>All the best, Dietrich</div><div style><br>
</div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 13, 2013 at 10:38 AM, Matthew Mondor <span dir="ltr"><<a href="mailto:mm_lists@pulsar-zone.net" target="_blank">mm_lists@pulsar-zone.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div class="h5">On Thu, 13 Jun 2013 10:30:33 +0900<br>
Dietrich Bollmann <<a href="mailto:dietrich@formgames.org">dietrich@formgames.org</a>> wrote:<br>
<br>
> CLOS relies on a garbage collector to destruct objects which are not<br>
> referenced anymore, so no explicit destructor method is foreseen.<br>
><br>
> However, when wrapping a C++ class into a CLOS class, the destructor of the<br>
> C++ object has to be called when the CLOS object is garbage collected to<br>
> free the foreign object.<br>
><br>
> Is there a way to hook into the CLOS object destruction process initiated<br>
> by the garbage collector in order to call the C++ destructor when the CLOS<br>
> object is garbage collected?<br>
<br>
</div></div>It is possible to register finalizers, although they may only execute<br>
when the GC actually discards the objects, thus it cannot execute<br>
predictably (see <a href="http://ecls.sourceforge.net/new-manual/ch28s05.html" target="_blank">http://ecls.sourceforge.net/new-manual/ch28s05.html</a>).<br>
<br>
If you need more performance and predictability, you may want to<br>
provide some WITH-* style macros internally using UNWIND-PROTECT as well<br>
--<br>
Matt<br>
<br>
------------------------------------------------------------------------------<br>
This SF.net email is sponsored by Windows:<br>
<br>
Build for Windows Store.<br>
<br>
<a href="http://p.sf.net/sfu/windows-dev2dev" target="_blank">http://p.sf.net/sfu/windows-dev2dev</a><br>
_______________________________________________<br>
Ecls-list mailing list<br>
<a href="mailto:Ecls-list@lists.sourceforge.net">Ecls-list@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/ecls-list" target="_blank">https://lists.sourceforge.net/lists/listinfo/ecls-list</a><br>
</blockquote></div><br></div></div>