I'm having a minor problem using SLIME with OpenMCL and it's Objective-C bridge. Specifically, I want the REPL and any other threads that get created by SLIME to process commands via OpenMCL to be wrapped by a with-autorelease-pool call (which is defined by the bridge) to prevent memory leakage when creating Obj-C objects. Where would be the appropriate places in swank-openmcl to accomplish this?
Thanks, Phil
After some clarification and experimentation, it looks like what needs to happen is something along the lines of (setf *listener-autorelease-pool* (ccl::create-autorelease-pool)) being executed on a newly created thread and a corresponding cleanup call that should be executed before the thread terminates. Do any hooks exist for this purpose?
Phil wrote:
I'm having a minor problem using SLIME with OpenMCL and it's Objective-C bridge. Specifically, I want the REPL and any other threads that get created by SLIME to process commands via OpenMCL to be wrapped by a with-autorelease-pool call (which is defined by the bridge) to prevent memory leakage when creating Obj-C objects. Where would be the appropriate places in swank-openmcl to accomplish this?
Thanks, Phil
* Phil [2006-08-22 10:39+0200] writes:
After some clarification and experimentation, it looks like what needs to happen is something along the lines of (setf *listener-autorelease-pool* (ccl::create-autorelease-pool)) being executed on a newly created thread and a corresponding cleanup call that should be executed before the thread terminates. Do any hooks exist for this purpose?
No, there aren't any hooks for this.
As as simple solution, you can redefine swank-backend:spawn. Create a file ~/.swank.lisp and put the code into that file. This file will be loaded at startup before any thread is created.
Helmut.