[Openmcl-devel] ccl:terminate doesn't seem to be working
raffaelcavallaro at mac.com
Fri Nov 5 13:15:00 CDT 2010
On Nov 5, 2010, at 2:08 PM, Ron Garret wrote:
> This leaks:
> (defclass foo () ((p :initform (#_malloc 4096))))
> (defmethod ccl:terminate ((f foo)) (#_free (slot-value f 'p)))
> (loop (make-foo))
> Even if you force a GC:
> (loop (dotimes (i 100000) (make-foo)) (gc))
> it still leaks. But it seems like it ought not to. Is this a bug, or am I doing something wrong?
You also need an initialize-instance :after method that calls:
(ccl::terminate-when-unreachable self) on the instance (assuming you've called the instance "self" of course).
raffaelcavallaro at me.com
More information about the Openmcl-devel