[Openmcl-devel] slime, cocoa, autorelease

Ben Hyde bhyde at pobox.com
Wed Feb 3 16:09:38 PST 2010


On Feb 3, 2010, at 6:18 PM, Stas Boukarev wrote:
> On Thu, Feb 4, 2010 at 1:49 AM, Ben Hyde <bhyde at pobox.com> wrote:
>> On Feb 3, 2010, at 11:20 AM, Ben Hyde wrote:
>>> It appears that the slime/swank REPL could use an auto release pool
>>> added to it's dynamic extent.   Anybody already on top of that?
>>>
>>> Note that you'd only notice this if your keeping an eye on the
>>> background stream.
>>>
>>> "2010-02-03 11:12:25.458 dx86cl64[55185:22903] ***
>>> _NSAutoreleaseNoPool(): Object 0x13a8b120 of class Cat autoreleased
>>> with no pool in place - just leaking
>>> Stack: (0x7fff8159f1e8 0x7fff814b7771 0x1b324)"
>>
>> Here's what I did.  Patch is to current slime HEAD.   The first bit
>> just move a macro earlier to avoid a compile warning.
>>
> That's not HEAD, because I already moved that macro couple  of weeks  
> ago.

Right you are.  Thanks.  Apparently my update had a -n on it.  Try  
again:

bash-3.2$ cvs diff -u swank-ccl.lisp
Index: swank-ccl.lisp
===================================================================
RCS file: /project/slime/cvsroot/slime/swank-ccl.lisp,v
retrieving revision 1.14
diff -u -r1.14 swank-ccl.lisp
--- swank-ccl.lisp	21 Jan 2010 23:21:26 -0000	1.14
+++ swank-ccl.lisp	4 Feb 2010 00:07:48 -0000
@@ -729,8 +729,13 @@
    (queue '() :type list))

  (defimplementation spawn (fun &key name)
-  (ccl:process-run-function (or name "Anonymous (Swank)")
-                            fun))
+  (flet ((process-function ()
+           #+apple-objc (let ((ccl::*listener-autorelease-pool*  
(ccl::create-autorelease-pool)))
+                          (unwind-protect
+                               (funcall fun)
+                            (ccl::release-autorelease-pool  
ccl::*listener-autorelease-pool*)))
+           #-apple-objc (funcall fun)))
+    (ccl:process-run-function (or name "Anonymous (Swank)") #'process- 
function)))

  (defimplementation thread-id (thread)
    (ccl:process-serial-number thread))
bash-3.2$ 



More information about the Openmcl-devel mailing list