From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Han-Wen Nienhuys Newsgroups: gmane.lisp.guile.devel Subject: Re: scm_mark_dependencies & guardians Date: Fri, 19 Jul 2002 23:03:03 +0200 Sender: guile-devel-admin@gnu.org Message-ID: <15672.32391.545193.512046@meddo.cs.uu.nl> References: <15671.15814.215112.357262@blauw.xs4all.nl> <873cufsgdq.fsf@zagadka.ping.de> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1027112727 19681 127.0.0.1 (19 Jul 2002 21:05:27 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 19 Jul 2002 21:05:27 +0000 (UTC) Cc: guile-devel@gnu.org, cmm@kakpryg.net Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 17VewH-00057K-00 for ; Fri, 19 Jul 2002 23:05:26 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17VewA-0002rv-00; Fri, 19 Jul 2002 17:05:18 -0400 Original-Received: from aurora.cs.uu.nl ([131.211.80.20] helo=mail.cs.uu.nl) by fencepost.gnu.org with esmtp (Exim 3.35 #1 (Debian)) id 17Veu0-0002eb-00 for ; Fri, 19 Jul 2002 17:03:04 -0400 Original-Received: from meddo.cs.uu.nl.cs.uu.nl (meddo.cs.uu.nl [131.211.80.91]) by mail.cs.uu.nl (Postfix) with ESMTP id 98BBA1CB2C2; Fri, 19 Jul 2002 23:03:03 +0200 (CEST) Original-To: Marius Vollmer In-Reply-To: <873cufsgdq.fsf@zagadka.ping.de> X-Mailer: VM 7.03 under Emacs 21.2.1 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:830 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:830 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