From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: port-for-each vs lazy sweep Date: Sat, 27 Oct 2007 17:07:44 +0200 Message-ID: <87d4v0a94v.fsf@chbouib.org> References: <878x88pbcc.fsf@zip.com.au> <46D0AB14.3030508@xs4all.nl> <8764328bxq.fsf@chbouib.org> <46D1C142.3080308@xs4all.nl> <87zm03ll78.fsf@laas.fr> <87r6kezirt.fsf@chbouib.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1193497754 5378 80.91.229.12 (27 Oct 2007 15:09:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 27 Oct 2007 15:09:14 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Oct 27 17:09:16 2007 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IlnHm-00013I-8p for guile-devel@m.gmane.org; Sat, 27 Oct 2007 17:09:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IlnHd-0000R3-Fp for guile-devel@m.gmane.org; Sat, 27 Oct 2007 11:09:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IlnHb-0000Pz-CU for guile-devel@gnu.org; Sat, 27 Oct 2007 11:09:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IlnHZ-0000Ox-Pp for guile-devel@gnu.org; Sat, 27 Oct 2007 11:09:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IlnHZ-0000Ou-JG for guile-devel@gnu.org; Sat, 27 Oct 2007 11:09:01 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IlnHZ-0006ou-2Z for guile-devel@gnu.org; Sat, 27 Oct 2007 11:09:01 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1IlnHE-0007WM-9R for guile-devel@gnu.org; Sat, 27 Oct 2007 15:08:40 +0000 Original-Received: from adh419.fdn.fr ([80.67.176.9]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Oct 2007 15:08:40 +0000 Original-Received: from ludo by adh419.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 27 Oct 2007 15:08:40 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 74 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: adh419.fdn.fr X-URL: http://www.laas.fr/~lcourtes/ 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: i486-pc-linux-gnu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:mopKLpy6Fp0iCmqJSdGgo62KY48= X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) 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:6858 Archived-At: --=-=-= Hi, I just fixed another bug (similar to the previous one) in the new port table, in HEAD. Thanks, Ludovic. --=-=-= Content-Type: text/x-patch; charset=iso-8859-1 Content-Disposition: inline; filename*=us-ascii''%2c%2cport-fix2.diff Content-Transfer-Encoding: 8bit Content-Description: The patch --- orig/libguile/ChangeLog +++ mod/libguile/ChangeLog @@ -1,3 +1,9 @@ +2007-10-27 Ludovic Courtès + + * fports.c (scm_i_evict_port): Expect a port, rather than a pair + containing the port. Fixes a bug in the new port table (2007-08-26). + (scm_evict_ports): Use `scm_c_port_for_each ()'. + 2007-10-21 Neil Jerram * eval.c (unmemoize_delay): Extend the environment before --- orig/libguile/fports.c +++ mod/libguile/fports.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -221,11 +221,10 @@ SCM_DEFINE (scm_setvbuf, "setvbuf", 2, 1 /* Move ports with the specified file descriptor to new descriptors, * resetting the revealed count to 0. */ -static SCM -scm_i_evict_port (SCM handle, void *closure) +static void +scm_i_evict_port (void *closure, SCM port) { int fd = * (int*) closure; - SCM port = SCM_CAR (handle); if (SCM_FPORTP (port)) { @@ -239,18 +238,12 @@ scm_i_evict_port (SCM handle, void *clos scm_set_port_revealed_x (port, scm_from_int (0)); } } - - return handle; } void scm_evict_ports (int fd) { - scm_i_scm_pthread_mutex_lock (&scm_i_port_table_mutex); - scm_internal_hash_for_each_handle (&scm_i_evict_port, - (void*) &fd, - scm_i_port_weak_hash); - scm_i_pthread_mutex_unlock (&scm_i_port_table_mutex); + scm_c_port_for_each (scm_i_evict_port, (void *) &fd); } --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel --=-=-=--