guile-user
[Top][All Lists]
Advanced

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

Re: C++ application linked with guile dos not quite


From: Hilaire Fernandes
Subject: Re: C++ application linked with guile dos not quite
Date: 18 Jun 2002 16:37:50 +0200

I do not use any scm_ methods actualy, I do not know anything about
them. I do not know if guile use it internaly then wait for it to be
unprotected.

Well I am wondering what is for scm_protect_object().
Is there some special procedure to free memory from a SCM object?
For example the value returned by a call to guile procedure?


Hilaire

Le mar 18/06/2002 à 15:43, Brett Viren a écrit :
> CDDP 40 - TICE writes:
>  > When guile is embedded in a C++ aplication, is there any garbage
>  > collection to take care of ?
> 
> Nothing specific about C++, however, if you store a returned SCM value
> that is not referenced by Guile, you should call scm_protect_object()
> on it.  I do this for example in a strip chart that plots a guile
> procedure.  I need to call scm_protect_object() when the SCM
> containing the proc. is created and then scm_unprotect_object() when
> my chart object dies.  I happen to store this SCM object in two places
> in C++, both need "protection".
> 
> Maybe if you are calling scm_protect_object() but failing to call
> scm_unprotect_object() then the garbage collector is waiting for the
> reference count to go to zero?  (I'm no expert, so take this with a
> grain of salt).
> 
> -Brett.
> 
-- 
http://www.ofset.org
Organization for Free Software in
Education and Teaching




reply via email to

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