RE: Finalization function for GC per object in LispWorks.

"Uģis Lācis (as ugis dot lacis at equa dot se)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <GV3P280MB1420B990982E9AF2D2F7E2C190CEA@GV3P280MB1420.SWEP280.PROD.OUTLOOK.COM>
Hi,

Thanks a lot for the suggestions, now I have few options to work with.

And Yuri, similarly as Tim mentioned, we need this to clean up objects outside of LISP. We load external DLLs and allocate objects in DLL memory space which are kept in memory and used via interaction with LISP application. Then after the corresponding object in LISP is destroyed, we need to explicitly tell the DLL to release the object from the memory.

Best,
Ugis

-----Original Message-----
From: Tim Bradshaw <[email protected]> 
Sent: Friday, 7 November 2025 23:37
To: Yuri Davidovsky <[email protected]>
Cc: Martin Simmons <[email protected]>; Tim Bradshaw <[email protected]>; Uģis Lācis <[email protected]>; [email protected]
Subject: Re: Finalization function for GC per object in LispWorks.

That's a much better solution!

> On 7 Nov 2025, at 20:24, Yuri Davidovsky <[email protected]> wrote:
> 
> 
> 
>> On 7 Nov 2025, at 21:11, Martin Simmons <[email protected]> wrote:
>> 
>> (defvar *finalizer-table*
>> (make-hash-table
>>  :test #'eq
>>  :weak-kind :key
>>  :free-function 'callfun))
> 
> This is actually very cool. Now it will be easy to destroy clos objects if they need that by adding them to the table during initialisation. I find in Lisp it is particularly easy to lose an object when playing with things in repl. What was the original intention behind adding this :free-function parameter?
> 
> _______________________________________________
> Lisp Hug - the mailing list for LispWorks users [email protected] 
> http://www.lispworks.com/support/lisp-hug.html

_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.