From: Han-Wen Nienhuys <hanwen@xs4all.nl>
Cc: jantien@xs4all.nl, guile-devel@gnu.org
Subject: Re: scm_gc_unprotect during GC
Date: Fri, 24 Sep 2004 11:24:42 +0200 [thread overview]
Message-ID: <16723.59354.746969.639727@byrd.xs4all.nl> (raw)
In-Reply-To: <87k6untixh.fsf@zagadka.ping.de>
mvo@zagadka.de writes:
> Han-Wen Nienhuys <hanwen@xs4all.nl> 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.
In other words, scm_gc_unprotect_object should check whether sweep is
in progress, and halt if that is the case. I added this change.
> 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.
Laziness, I suppose. We have a precooked Protected_scm class that
takes care of calling protect and unprotect. I've changed all our
smobs to stop using it.
--
Han-Wen Nienhuys | hanwen@xs4all.nl | http://www.xs4all.nl/~hanwen
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel
prev parent reply other threads:[~2004-09-24 9:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-11 1:23 scm_gc_unprotect during GC Han-Wen Nienhuys
2004-09-21 21:23 ` Marius Vollmer
2004-09-24 9:24 ` Han-Wen Nienhuys [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16723.59354.746969.639727@byrd.xs4all.nl \
--to=hanwen@xs4all.nl \
--cc=guile-devel@gnu.org \
--cc=jantien@xs4all.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).