guile-user
[Top][All Lists]
Advanced

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

Re: Calling scheme from C: problem with GC.


From: Rob Browning
Subject: Re: Calling scheme from C: problem with GC.
Date: Mon, 26 Nov 2001 15:23:31 -0600
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1

Chris Cramer <address@hidden> writes:

> 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).

I've seen this suggested in a number of places, but what's the harm in
just always using scm_protect/unprotect_object.  Is there some
performance penalty or similar if you're using it for a large number
of items?

-- 
Rob Browning
rlb @defaultvalue.org, @linuxdevel.com, and @debian.org
Previously @cs.utexas.edu
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD



reply via email to

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