summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-03-19 20:59:37 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-03-19 20:59:37 +0000
commitf2f6ab5ed2d2f824b4f6c3085a4a2275c2f8500a (patch)
tree9c4ade8213cf4bb730b5a2f1eb82b8644cb1ce57 /sv.c
parent1e0e26cb26fde01fd11e7cf9703ff3045aed4e51 (diff)
parent982b7775e1ad97c44654b5fd0132bfeb9eacc46e (diff)
downloadperl-f2f6ab5ed2d2f824b4f6c3085a4a2275c2f8500a.tar.gz
Integrate mainline.
p4raw-id: //depot/perlio@9249
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/sv.c b/sv.c
index 1b367448a6..6d6d39e9f5 100644
--- a/sv.c
+++ b/sv.c
@@ -147,20 +147,24 @@ S_more_sv(pTHX)
return sv;
}
-STATIC void
+STATIC I32
S_visit(pTHX_ SVFUNC_t f)
{
SV* sva;
SV* sv;
register SV* svend;
+ I32 visited = 0;
for (sva = PL_sv_arenaroot; sva; sva = (SV*)SvANY(sva)) {
svend = &sva[SvREFCNT(sva)];
for (sv = sva + 1; sv < svend; ++sv) {
- if (SvTYPE(sv) != SVTYPEMASK)
+ if (SvTYPE(sv) != SVTYPEMASK && SvREFCNT(sv)) {
(FCALL)(aTHXo_ sv);
+ ++visited;
+ }
}
}
+ return visited;
}
void
@@ -181,12 +185,14 @@ Perl_sv_clean_objs(pTHX)
PL_in_clean_objs = FALSE;
}
-void
+I32
Perl_sv_clean_all(pTHX)
{
+ I32 cleaned;
PL_in_clean_all = TRUE;
- visit(do_clean_all);
+ cleaned = visit(do_clean_all);
PL_in_clean_all = FALSE;
+ return cleaned;
}
void
@@ -8192,7 +8198,7 @@ dup_pvcv:
CvROOT(dstr) = OpREFCNT_inc(CvROOT(sstr));
CvXSUB(dstr) = CvXSUB(sstr);
CvXSUBANY(dstr) = CvXSUBANY(sstr);
- CvGV(dstr) = gv_dup_inc(CvGV(sstr));
+ CvGV(dstr) = gv_dup(CvGV(sstr));
CvDEPTH(dstr) = CvDEPTH(sstr);
if (CvPADLIST(sstr) && !AvREAL(CvPADLIST(sstr))) {
/* XXX padlists are real, but pretend to be not */
@@ -8260,7 +8266,7 @@ Perl_cx_dup(pTHX_ PERL_CONTEXT *cxs, I32 ix, I32 max)
ncx->blk_sub.argarray = (cx->blk_sub.hasargs
? av_dup_inc(cx->blk_sub.argarray)
: Nullav);
- ncx->blk_sub.savearray = av_dup(cx->blk_sub.savearray);
+ ncx->blk_sub.savearray = av_dup_inc(cx->blk_sub.savearray);
ncx->blk_sub.olddepth = cx->blk_sub.olddepth;
ncx->blk_sub.hasargs = cx->blk_sub.hasargs;
ncx->blk_sub.lval = cx->blk_sub.lval;
@@ -8847,7 +8853,7 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags,
PL_defgv = gv_dup(proto_perl->Idefgv);
PL_argvgv = gv_dup(proto_perl->Iargvgv);
PL_argvoutgv = gv_dup(proto_perl->Iargvoutgv);
- PL_argvout_stack = av_dup(proto_perl->Iargvout_stack);
+ PL_argvout_stack = av_dup_inc(proto_perl->Iargvout_stack);
/* shortcuts to regexp stuff */
PL_replgv = gv_dup(proto_perl->Ireplgv);