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: [PATCH] Reference leak in `iprin1 ()' Date: Thu, 10 Nov 2005 10:47:17 +0100 Organization: LAAS-CNRS Message-ID: <87wtjghm1m.fsf_-_@laas.fr> References: <87y83z3vh5.fsf@laas.fr> <4371CF46.4010708@xs4all.nl> <87y83xkcq6.fsf@laas.fr> <8764r18r2j.fsf@zip.com.au> 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 1131624820 17679 80.91.229.2 (10 Nov 2005 12:13:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 10 Nov 2005 12:13:40 +0000 (UTC) Cc: Han-Wen Nienhuys Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Nov 10 13:13:33 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EaBHX-0008Tk-Ri for guile-devel@m.gmane.org; Thu, 10 Nov 2005 13:11:56 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EaBHW-0004X3-LL for guile-devel@m.gmane.org; Thu, 10 Nov 2005 07:11:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ea9fc-0006rk-GI for guile-devel@gnu.org; Thu, 10 Nov 2005 05:28:42 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ea97g-0005HE-39 for guile-devel@gnu.org; Thu, 10 Nov 2005 04:53:39 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ea925-0004og-QB for guile-devel@gnu.org; Thu, 10 Nov 2005 04:47:51 -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 1Ea925-0004l4-Ro for guile-devel@gnu.org; Thu, 10 Nov 2005 04:47:50 -0500 Original-Received: by laas.laas.fr (8.13.1/8.13.4) with SMTP id jAA9lkuR005571; Thu, 10 Nov 2005 10:47:46 +0100 (CET) Original-To: guile-devel@gnu.org X-URL: http://www.laas.fr/~lcourtes/ X-Revolutionary-Date: 20 Brumaire 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: guile-devel@gnu.org, Han-Wen Nienhuys In-Reply-To: <8764r18r2j.fsf@zip.com.au> (Kevin Ryde's message of "Thu, 10 Nov 2005 08:11:16 +1100") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) X-Spam-Score: 0.496 () MAILTO_TO_SPAM_ADDR X-Scanned-By: MIMEDefang at CNRS-LAAS X-MIME-Autoconverted: from 8bit to quoted-printable by laas.laas.fr id jAA9lkuR005571 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:5387 Archived-At: Hi, Kevin Ryde writes: > I may have struck that or something similar a while back. Mikael > explained it was a reference held in the print data of the output > port, or something. Used to detect cyclic structures, or something. Thanks: you put me on the right track! So this issue is now gone. :-) Ludovic. 2005-11-10 Ludovic Court=E8s * print.c (EXIT_NESTED_DATA): Before popping from the stack, reset the value at its top. This fixes a reference leak. --- orig/libguile/print.c +++ mod/libguile/print.c @@ -136,7 +136,13 @@ PUSH_REF(pstate, obj); \ } while(0) =20 -#define EXIT_NESTED_DATA(pstate) { --pstate->top; } +#define EXIT_NESTED_DATA(pstate) \ +do \ +{ \ + PSTATE_STACK_SET (pstate, pstate->top, SCM_UNDEFINED); \ + --pstate->top; \ +} \ +while (0) =20 SCM scm_print_state_vtable =3D SCM_BOOL_F; static SCM print_state_pool =3D SCM_EOL; @@ -144,8 +150,8 @@ =20 #ifdef GUILE_DEBUG /* Used for debugging purposes */ =20 -SCM_DEFINE (scm_current_pstate, "current-pstate", 0, 0, 0,=20 - (), +SCM_DEFINE (scm_current_pstate, "current-pstate", 0, 0, 0, + (void), "Return the current-pstate -- the car of the\n" "@code{print_state_pool}. @code{current-pstate} is only\n" "included in @code{--enable-guile-debug} builds.") _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel