Lisp HUG Maillist Archive

Special Free actions on Foreign pointers

Hi list,

Is it possible to set a particular "free-action" to a foreign  
pointer... ?
I've read about the hcl::flag-special-free-action / hcl::add-special- 
free-action possibility, but in case of special processing to apply  
on a given foreign pointer, this system does not allow to  
differenciate it.

If I have two foreign functions f1 and f2 that both return pointers,  
but to be "cleaned up" each by specific functions : clear-pointer- 
from-f1 and clean-pointer-from-f2, a common "special-free-function"  
will not differenciate between both (and between other possible  
foreign pointers).

As a solution, I guess it is possible to create a new struct or class  
in which would be encapsulated the results from f1 and f2, and which  
type could be tested in the free-function, but isn't it a twisted way  
to proceed. Is there better solutions?

Thanks.

Jean Bresson


Re: Special Free actions on Foreign pointers

On Tue, 4 Mar 2008 17:03:24 +0100, Jean Bresson <Jean.Bresson@ircam.fr> wrote:

> As a solution, I guess it is possible to create a new struct or
> class in which would be encapsulated the results from f1 and f2, and
> which type could be tested in the free-function, but isn't it a
> twisted way to proceed.

FWIW, I've done the same in RDNZL.  You can look at the source code if
you're interested.

Edi.


Re: Special Free actions on Foreign pointers

Unable to parse email body. Email id is 7817

Updated at: 2020-12-10 08:43 UTC