[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GC-related question
Quoting "John R. Hall":
> I want the Scheme representations of these structures to be GC'ed
> normally (so that the bindings can be conveniently used in
> functional-style programs), but I need to be able to free the data they
> represent before they are lost. How can I do this?
>
> The scheme_register_finalizer function looks something like what I need,
> but I'm not sure.
Yes, that's what you want. A finalzer for a GCable object is called
when the object would otherwise have beeen reclaimed. So, your finalizer
will free the malloced data associated with the Scheme object.
Matthew