Change 33595 by [EMAIL PROTECTED] on 2008/03/29 00:30:42
Subject: [PATCH] do not use SVTYPEMASK to prevent cleaning of PL_fdpid
and PL_strtab
From: Gerard Goossen <[EMAIL PROTECTED]>
Message-ID: <[EMAIL PROTECTED]>
Date: Wed, 26 Mar 2008 14:07:13 +0100
Affected files ...
... //depot/perl/perl.c#865 edit
... //depot/perl/sv.c#1530 edit
Differences ...
==== //depot/perl/perl.c#865 (text) ====
Index: perl/perl.c
--- perl/perl.c#864~33407~ 2008-03-01 23:24:18.000000000 -0800
+++ perl/perl.c 2008-03-28 17:30:42.000000000 -0700
@@ -1127,18 +1127,11 @@
}
/* Now absolutely destruct everything, somehow or other, loops or no. */
- SvFLAGS(PL_fdpid) |= SVTYPEMASK; /* don't clean out pid table
now */
- SvFLAGS(PL_strtab) |= SVTYPEMASK; /* don't clean out strtab now */
/* the 2 is for PL_fdpid and PL_strtab */
- while (PL_sv_count > 2 && sv_clean_all())
+ while (sv_clean_all() > 2)
;
- SvFLAGS(PL_fdpid) &= ~SVTYPEMASK;
- SvFLAGS(PL_fdpid) |= SVt_PVAV;
- SvFLAGS(PL_strtab) &= ~SVTYPEMASK;
- SvFLAGS(PL_strtab) |= SVt_PVHV;
-
AvREAL_off(PL_fdpid); /* no surviving entries */
SvREFCNT_dec(PL_fdpid); /* needed in io_close() */
PL_fdpid = NULL;
==== //depot/perl/sv.c#1530 (text) ====
Index: perl/sv.c
--- perl/sv.c#1529~33579~ 2008-03-26 11:59:03.000000000 -0700
+++ perl/sv.c 2008-03-28 17:30:42.000000000 -0700
@@ -516,6 +516,8 @@
do_clean_all(pTHX_ SV *const sv)
{
dVAR;
+ if (sv == PL_fdpid || sv == PL_strtab) /* don't clean pid table and strtab
*/
+ return;
DEBUG_D((PerlIO_printf(Perl_debug_log, "Cleaning loops: SV at
0x%"UVxf"\n", PTR2UV(sv)) ));
SvFLAGS(sv) |= SVf_BREAK;
SvREFCNT_dec(sv);
End of Patch.