<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>See <a href="https://ccl.clozure.com/manual/chapter13.11.html">https://ccl.clozure.com/manual/chapter13.11.html</a></p>
<p>See <a href="https://github.com/trivial-garbage/trivial-garbage/blob/3474f6414b73d4e3aa2d5c53080f4247a34f6380/trivial-garbage.lisp#L386-L392">https://github.com/trivial-garbage/trivial-garbage/blob/3474f6414b73d4e3aa2d5c53080f4247a34f6380/trivial-garbage.lisp#L386-L392</a></p>
<p id="reply-intro">W dniu 2024-02-01 20:40, Grégory Vanuxem napisaĆ(a):</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div class="pre" style="margin: 0; padding: 0; font-family: monospace">Hello,<br /><br />My question is in object, when the garbage collector releases memory<br />from a variable for example does Clozure CL allow the user to add a<br />"hook" function to do some other things? Namely I also need to release<br />memory in another place not known to the garbage collector. Here is a<br />piece of code for<br />other CL implementations:<br /><br />(defun make_jlref (val type)<br /> (let* ((ret (make-instance 'jlref :val val :type type))<br /> (hash (write-to-string (sxhash ret) :base 16)))<br /> #+:lispworks (flag-special-free-action hash)<br /> #+:cmu (ext:finalize ret (lambda () (free_jlref hash)))<br /> #+:sbcl (sb-ext:finalize ret (lambda () (free_jlref hash)))<br /> #+:allegro (excl:schedule-finalization ret (lambda ()<br />(free_jlref hash)))<br /> (setf (jlrefId ret) hash)<br /> ret))<br /><br />Regards,<br />- Greg</div>
</blockquote>
<p><br /></p>
</body></html>