From: Han-Wen Nienhuys <hanwen@cs.uu.nl>
Cc: guile-devel@gnu.org, cmm@kakpryg.net
Subject: Re: scm_mark_dependencies & guardians
Date: Fri, 19 Jul 2002 23:03:03 +0200 [thread overview]
Message-ID: <15672.32391.545193.512046@meddo.cs.uu.nl> (raw)
In-Reply-To: <873cufsgdq.fsf@zagadka.ping.de>
mvo@zagadka.ping.de writes:
> I don't want to comment on the big picture, just one note: it is
> important that marking is done in a 'tail calling' way. That is, we
> must not recurse when marking the spine of a list, for example. That
> is the reason for the goto in gc_mark.
Sure, otherwise you get stack overflow.
> Hmm, I don't think we should fear goto. Sometimes it is clearer to
> use goto than it is to avoid it. The main spaghetti in gc.c is the
> inclusion in itself. What about moving the marking code into a
> separate file and including it twice? We already do this for
> num2float and num2integral.
I already recoded it without inclusion. You can get around including a
file twice by doing
mark (SCM p)
{
if (marked(p)) return;
set_mark(p);
mark_dependencies (p);
}
mark_dependencies(SCM p)
{
again:
switch (tag(p))
{
.... // lots of cases jumping to mark_next
}
return;
mark_next:
if (marked(p)) return;
set_mark(p);
goto again;
}
--
Han-Wen Nienhuys | hanwen@cs.uu.nl | http://www.cs.uu.nl/~hanwen/
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
prev parent reply other threads:[~2002-07-19 21:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-07-18 22:14 scm_mark_dependencies & guardians Han-Wen
2002-07-19 18:48 ` Marius Vollmer
2002-07-19 21:03 ` 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=15672.32391.545193.512046@meddo.cs.uu.nl \
--to=hanwen@cs.uu.nl \
--cc=cmm@kakpryg.net \
--cc=guile-devel@gnu.org \
/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).