[Top][All Lists]

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

Re: Calling scheme from C: problem with GC.

From: Chris Cramer
Subject: Re: Calling scheme from C: problem with GC.
Date: Sat, 24 Nov 2001 21:03:37 -0600
User-agent: Mutt/1.2.5i

On Fri, Nov 23, 2001 at 10:33:36AM -0500, Alejandro Forero Cuervo wrote:
> Guile calls the C procedure that I bound to hb-register which stores
> its second parameter (the procedure) somewhere for latter use and
> returns.  How do I inform Guile that it will be needed after the C
> procedure returns?

I think what you need is scm_gc_protect_object(). It takes one argument,
the object you want to protect from garbage collection. Unprotect it with
scm_gc_unprotect_object(). If you want to protect multiple objects, it
may be a better idea to place them in a vector or list and then protect
that (since protecting an object also protects everything it references).

C. Ray C. aka Christopher Cramer

reply via email to

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