From: Dan Sugalski Date: Wed, 9 Oct 2002 18:48:27 +0000 (-0800) Subject: import Devel-Size 0.51 from CPAN X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FDevel-Size.git;a=commitdiff_plain;h=e96acca968cf23f1c8e3aea35b251dedbc925a5b import Devel-Size 0.51 from CPAN git-cpan-module: Devel-Size git-cpan-version: 0.51 git-cpan-authorid: DSUGAL git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.51.tar.gz --- diff --git a/Size.pm b/Size.pm index 93472ef..2c46e3f 100644 --- a/Size.pm +++ b/Size.pm @@ -24,7 +24,7 @@ require DynaLoader; @EXPORT = qw( ); -$VERSION = '0.50'; +$VERSION = '0.51'; bootstrap Devel::Size $VERSION; diff --git a/Size.xs b/Size.xs index dd61be7..e92dbe6 100644 --- a/Size.xs +++ b/Size.xs @@ -234,13 +234,13 @@ CODE: av_push(pending_array, thing); /* Now just yank things off the end of the array until it's done */ - while (&PL_sv_undef != (thing = av_pop(pending_array))) { + while (av_len(pending_array) >= 0) { + thing = av_pop(pending_array); /* Process it if we've not seen it */ if (check_new(tracking_hash, thing)) { - /* First, is it pointing to or contraining something else? */ - if (SvOK(thing)) { + /* Is it valid? */ + if (thing) { /* Yes, it is. So let's check the type */ - switch (SvTYPE(thing)) { case SVt_RV: av_push(pending_array, SvRV(thing)); @@ -271,10 +271,18 @@ CODE: break; case SVt_PVHV: + /* Is there anything in here? */ + if (hv_iterinit((HV *)thing)) { + SV *temp_thing; + while (&PL_sv_undef != + (temp_thing = hv_iternextsv((HV *)thing, NULL, NULL))) { + av_push(pending_array, temp_thing); + } + } break; default: - puts("Dunno"); + break; } }