[Ecls-list] *finalize-hook* ??
Juan Jose Garcia Ripoll
lisp at arrakis.es
Tue Nov 29 07:39:09 UTC 2005
On Tue, 2005-11-29 at 16:08 +0100, Goffioul Michael wrote:
> Is it possible to add finalization capabilities to ECL? What I'd like
> is to be able to register a handler for a given object, which would be
> called when the object is GC'ed (the handler would be called with the
> object as argument).
The problem is that AFAIK it is not safe to call the allocation routines
from finalizer routines and lisp code cannot be guaranteed to be
cons-free. Not even compiled one. If you want to add finalizers, they
should be low-level C code and you can attach them using the
Boehm-Weiser routines (See alloc_2.d for an example).
Regards,
Juanjo
More information about the ecl-devel
mailing list