guile-user
[Top][All Lists]
Advanced

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

Re: Is my procedure getting GCed?


From: Bill Gribble
Subject: Re: Is my procedure getting GCed?
Date: Tue, 1 May 2001 12:40:24 -0500
User-agent: Mutt/1.3.17i

On Tue, May 01, 2001 at 07:59:01PM +0300, Michael Livshin wrote:
> scm_protect_object (fProc); // once fProc is intialized, of course
> scm_unprotect_object (fProc);

This may be more Ritual Incantation than reasoned action, but I
believe you also need to make sure to call unprotect/protect when you
assign a new value to the C struct slot:

struct foo {
   SCM bar;
};

[...]
   SCM  new_val;
   foo  * bax;
   
   /* scm_protect_object should have been called in the initializer
    * for 'bax' */ 
   scm_unprotect_object(bax->bar);
   bax->bar = new_val;
   scm_protect_object(bax->bar);

b.g.



reply via email to

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