summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-03-18 18:39:21 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-03-18 18:39:21 +0000
commit5226ed68d621722eb9fc1e4a926ee31169462427 (patch)
tree5bf1ff45e8024e6c9975db9868acb4b76d5c4038 /sv.c
parent80a52c5e06f5eb1d9ac053062d7c7fc775cfe5c5 (diff)
downloadperl-5226ed68d621722eb9fc1e4a926ee31169462427.tar.gz
Integrate change #9197 from maintperl to mainline.
more thorough cleaning of arenas. p4raw-link: @9197 on //depot/maint-5.6/perl: ec3d44d040803cac937295d8f4740e6a36ba30fb p4raw-id: //depot/perl@9201 p4raw-integrated: from //depot/maint-5.6/perl@9200 'merge in' t/op/sort.t (@7895..) perl.c (@9064..) sv.c (@9108..) embed.pl proto.h (@9154..)
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sv.c b/sv.c
index 18c5ac95b9..d08c378349 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) {
(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