![](https://secure.gravatar.com/avatar/9c0ede9a94a934a670c96a955881f439.jpg?s=120&d=mm&r=g)
On 27 Sep 2005 13:21:33 +0200, Immanuel Litzroth <immanuell@enfocus.be> said:
Immanuel> * I often need to allocate foreign objects and put them in a lisp struct. I would Immanuel> then want to run a finalizer if the struct gets garbage collected, to free the allocated Immanuel> memory. A nice interface to the finalizer functionality on different systems would Immanuel> be a great feature for cffi. How do you keep control over what foreign things point to the foreign objects? I've found that losing the last reference from Lisp is not usually a guarantee that the last reference is lost from the foreign side. Conversely, if you work around this by deliberately keeping a reference from Lisp to prevent the foreign object from being finalized, then you probably know exactly when it should be freed anyway. -- Martin Simmons Email: martin@lispworks.com LispWorks Ltd, St John's Innovation Centre TEL: +44 1223 421860 Cowley Road, Cambridge CB4 0WS, England. FAX: +44 870 2206189