[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Reference leak in `iprin1 ()'
From: |
Ludovic Courtès |
Subject: |
[PATCH] Reference leak in `iprin1 ()' |
Date: |
Thu, 10 Nov 2005 10:47:17 +0100 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Hi,
Kevin Ryde <address@hidden> 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ès <address@hidden>
* 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)
-#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)
SCM scm_print_state_vtable = SCM_BOOL_F;
static SCM print_state_pool = SCM_EOL;
@@ -144,8 +150,8 @@
#ifdef GUILE_DEBUG /* Used for debugging purposes */
-SCM_DEFINE (scm_current_pstate, "current-pstate", 0, 0, 0,
- (),
+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.")
- [PATCH] Marking weak alist vectors, Ludovic Courtès, 2005/11/08
- Re: [PATCH] Marking weak alist vectors, Marius Vollmer, 2005/11/08
- Re: [PATCH] Marking weak alist vectors, Han-Wen Nienhuys, 2005/11/09
- Re: [PATCH] Marking weak alist vectors, Ludovic Courtès, 2005/11/09
- [PATCH] Reference leak in `iprin1 ()',
Ludovic Courtès <=
- Re: [PATCH] Reference leak in `iprin1 ()', Neil Jerram, 2005/11/12
- Re: [PATCH] Reference leak in `iprin1 ()', Ludovic Courtès, 2005/11/14
- Re: [PATCH] Reference leak in `iprin1 ()', Neil Jerram, 2005/11/16
- Re: [PATCH] Reference leak in `iprin1 ()', Ludovic Courtès, 2005/11/17
- Re: [PATCH] Reference leak in `iprin1 ()', Neil Jerram, 2005/11/17
- Re: [PATCH] Marking weak alist vectors, #2, Ludovic Courtès, 2005/11/23
- Re: [PATCH] Marking weak alist vectors, #2, Han-Wen Nienhuys, 2005/11/23
- Re: [PATCH] Marking weak alist vectors, #2, Ludovic Courtès, 2005/11/24
- Re: [PATCH] Marking weak alist vectors, #2, Kevin Ryde, 2005/11/25
[PATCH] Fixing `gc-live-object-stats', Ludovic Courtès, 2005/11/17