chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Setting up hooks in garbage collection


From: Paulo Jabardo
Subject: [Chicken-users] Setting up hooks in garbage collection
Date: Tue, 2 Jan 2007 13:15:22 -0800 (PST)

I'm beginning to develop a chicken interface to the GNU scientific library 
(gsl). Several numerical procedures involve an operation such as:

gsl_XXX *ptr = gsl_XXX_alloc(...)

...

gsl_XXX_free(ptr)


I would like to define a chicken variable that manages the pointer. But I don't 
want to explicitely call the XXX_free function. Something like:

(define resource (make-gsl-XXX ...))

When the garbage collector collects resource, it would automatically call the 
function gsl_XXX_free (or a chicken wrapper of it).

Is that even possible?
If it isn't could someone suggest a "schemish" approach to the problem?

Thanks

Paulo



__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger 
http://br.messenger.yahoo.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]