[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scm_gc_unprotect during GC
From: |
Marius Vollmer |
Subject: |
Re: scm_gc_unprotect during GC |
Date: |
Tue, 21 Sep 2004 23:23:54 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) |
Han-Wen Nienhuys <address@hidden> writes:
> A short term solution is to make sure that LilyPond never does
> scm_gc_unprotect_object() from smobbed destructor. However, I feel
> that this is a kludge.
>
> Either scm_gc_unprotect_object is callable during sweep, or this is
> forbidden. At present, GUILE does not print a warning, but barfs in an
> unrelated location.
Yes, that's unfortunate. Almost anything is forbidden during sweep,
and we need to document that more clearly.
I'd say that a smob free function should not call
scm_gc_unprotect_object, or any other function that accesses the heap.
The heap might be in an inconsistent state, etc. We probably should
list all functions that are callable, starting with just scm_gc_free.
Why do you need to call scm_gc_unprotect_object from your smob free
function? To release a SCM value that was in use by the smob? The
usual way to do that is to mark that value in the smob mark function.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405