From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludovic.courtes@laas.fr (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Marking weak alist vectors, epilogue Date: Mon, 09 Jan 2006 15:51:37 +0100 Organization: LAAS-CNRS Message-ID: <87zmm53152.fsf_-_@laas.fr> References: <87y83z3vh5.fsf@laas.fr> <4371CF46.4010708@xs4all.nl> <87y83xkcq6.fsf@laas.fr> <87sltny8dh.fsf_-_@laas.fr> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1137198573 27454 80.91.229.2 (14 Jan 2006 00:29:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 14 Jan 2006 00:29:33 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Jan 14 01:29:31 2006 Return-path: Envelope-to: guile-devel@gmane.org Original-Received: from mail-relay.eunet.no ([193.71.71.242]) by ciao.gmane.org with esmtp (Exim 4.43) id 1ExZ9c-0003bP-Lk for guile-devel@gmane.org; Sat, 14 Jan 2006 01:20:24 +0100 Original-Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) by mail-relay.eunet.no (8.13.1/8.13.1/GN) with ESMTP id k09HWKcL012090 for ; Mon, 9 Jan 2006 18:33:03 +0100 (CET) (envelope-from guile-devel-bounces+guile-devel=m.gmane.org@gnu.org) Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ew0v7-0002Yz-La for guile-devel@m.gmane.org; Mon, 09 Jan 2006 12:35:01 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EvygB-0008G0-E3 for guile-devel@gnu.org; Mon, 09 Jan 2006 10:11:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EvyWb-0004zl-3F for guile-devel@gnu.org; Mon, 09 Jan 2006 10:01:34 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EvyP3-000276-Bk for guile-devel@gnu.org; Mon, 09 Jan 2006 09:53:45 -0500 Original-Received: from [140.93.0.15] (helo=laas.laas.fr) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EvyRL-000346-Af for guile-devel@gnu.org; Mon, 09 Jan 2006 09:56:07 -0500 Original-Received: by laas.laas.fr (8.13.1/8.13.4) with SMTP id k09EpeGE018185; Mon, 9 Jan 2006 15:51:42 +0100 (CET) Original-To: Han-Wen Nienhuys X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 20 =?iso-8859-1?Q?Niv=F4se?= an 214 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEB1F5364 X-PGP-Key: http://www.laas.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: powerpc-unknown-linux-gnu Mail-Followup-To: Han-Wen Nienhuys , guile-devel@gnu.org In-Reply-To: <87sltny8dh.fsf_-_@laas.fr> (Ludovic =?iso-8859-1?Q?Court=E8s?= =?iso-8859-1?Q?'s?= message of "Wed, 23 Nov 2005 11:19:06 +0100") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) X-Spam-Score: 0 () X-Scanned-By: MIMEDefang at CNRS-LAAS X-MIME-Autoconverted: from 8bit to quoted-printable by laas.laas.fr id k09EpeGE018185 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:5589 Archived-At: Hi all, ludovic.courtes@laas.fr (Ludovic Court=E8s) writes: > Below is an improved version of the patch I originally sent. The goal > of the original patch (and associated test case) was to ensure that an > object associated to a weak key (resp. a weak value) is GC'd _after_ > that key (resp. value). > > However, as Han-Wen pointed out earlier in this thread, with the > original patch, cyclical structures within a weak-key (or weak-value) > alist vectors would never become unmarked. I'm afraid no one cares but this second patch is somewhat broken, too, in that its delayed marking phase (iterating through MARK_QUEUE) is "not deferred enough". Iterating though MARK_QUEUE should be done after _all_ weak vectors have been traversed in `scm_i_remove_weaks ()'. Implementing it would require to know the total number of weak vectors so that, at the beginning of `scm_i_remove_weaks ()' we can allocate (on the stack) a vector of such "mark queues" and only iterate through it before exiting. I'm not going to do it I guess (i) because it is getting complicated and (ii) well, because apparently no one feels concerned by the issue I was trying to solve, so maybe it's just unimportant after all. ;-) Conclusions: 1. If we're not going to solve this problem, at least it should be very well documented. 2. The test case currently in CVS is broken and could be either removed or replaced by something along the lines of what I posted earlier (I mean `weaks.test'). 3. I had posted the tiny fix below which still seems valuable. Thanks, Ludovic. --- orig/libguile/properties.c +++ mod/libguile/properties.c @@ -125,6 +125,7 @@ scm_init_properties () { scm_properties_whash =3D scm_make_weak_key_hash_table (SCM_UNDEFINED); + scm_properties_whash =3D scm_permanent_object (scm_properties_whash); #include "libguile/properties.x" } =20 _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel