Guile Mailing List Archive

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

Re: [LONG] Re: Calling Scheme from C and Garbage Collection



Etienne Bernard <eb@via.ecp.fr> writes:

> I think I have to scm_gc_mark() the regexp I compiled myself so that it
> can not be garbage collected, right ? (this is what I've deduced from the
> little documentation I have, and code I can read :-)

You should only have to do your own marking if you have a smob you
defined that keeps a pointer to a SCM value.  Otherwise, the system
should do it for you.

Maybe you are keeping a pointer to a SCM value that is not protected
from gc?  After you allocate a compiled regexp, how do you make sure
that it never gets gc'ed?  Maybe all you need is a scm_protect_obj().

Sorry if this has already been discussed.

-russ

--
"People who fight may lose. People who do not fight have already lost." 
             -- Bertold Brecht

Guile Home | Main Index | Thread Index