From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.user Subject: Re: out-of-order GC Date: 31 Dec 2002 20:13:34 +0000 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1041367292 15475 80.91.224.249 (31 Dec 2002 20:41:32 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 31 Dec 2002 20:41:32 +0000 (UTC) Cc: guile-user@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18TTCc-00041R-00 for ; Tue, 31 Dec 2002 21:41:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18TTCC-0002ql-04 for guile-user@m.gmane.org; Tue, 31 Dec 2002 15:41:04 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18TTBh-0002kb-00 for guile-user@gnu.org; Tue, 31 Dec 2002 15:40:33 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18TTAX-00029g-00 for guile-user@gnu.org; Tue, 31 Dec 2002 15:39:22 -0500 Original-Received: from mail.uklinux.net ([80.84.72.21] helo=s1.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18TTA4-00025t-00 for guile-user@gnu.org; Tue, 31 Dec 2002 15:38:52 -0500 Original-Received: from laruns.ossau.uklinux.net (bts-0959.dialup.zetnet.co.uk [194.247.51.191]) by s1.uklinux.net (8.11.6/8.11.6) with ESMTP id gBVKcnJ20066; Tue, 31 Dec 2002 20:38:49 GMT Original-Received: from laruns.ossau.uklinux.net.ossau.uklinux.net (localhost [127.0.0.1])ESMTP id CFBFDDC4D3; Tue, 31 Dec 2002 20:13:34 +0000 (GMT) Original-To: redhog@redhog.org In-Reply-To: Original-Lines: 35 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1490 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1490 >>>>> "Egil" == Egil Moeller writes: Egil> The problem thus never araised when there was a referense to Egil> the transaction-SMOB, only when there where no reference to Egil> neither one any more... This is identical to the problem that I had in guile-xlib (with connection -> Display and transaction -> window/pixmap/whatever). Here is the relevant comment from xlib.c... /* Note on garbage collection and freeing of X resources. The one wrinkle in implementing automatic freeing of X resources is that almost all X resources depend on a valid display, so we have to be careful that the display resource is always freed (using XCloseDisplay) last of all. In most cases this is handled by having resource smobs include a reference to the display smob. But there is still a problem when all remaining X resource references are dropped between one GC cycle and the next: when this happens, the next GC sweep could free the display smob before it gets to some of the other resource smobs. Fortunately, resource smobs can check, in their free functions, whether this has happened, by looking at the SCM_TYP16 of their reference to the display smob. If the display smob is still valid, this will be scm_tc16_xdisplay, and the relevant X resource should be freed as normal. If the display smob has been freed earlier in this sweep, GC will have set its SCM_TYP16 to scm_tc_free_cell; this indicates that XCloseDisplay has already been called, and so the relevant X resource no longer needs to be freed. */ Regards, Neil _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user