From: Dan Sugalski Date: Tue, 8 Oct 2002 18:04:15 +0000 (-0800) Subject: import Devel-Size 0.03 from CPAN X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ab42718926473a80fab54000ffbdb7fa22732e6;p=p5sagit%2FDevel-Size.git import Devel-Size 0.03 from CPAN git-cpan-module: Devel-Size git-cpan-version: 0.03 git-cpan-authorid: DSUGAL git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.03.tar.gz --- diff --git a/Size.pm b/Size.pm index a85067e..7756894 100644 --- a/Size.pm +++ b/Size.pm @@ -24,7 +24,7 @@ require DynaLoader; @EXPORT = qw( ); -$VERSION = '0.02'; +$VERSION = '0.03'; bootstrap Devel::Size $VERSION; @@ -58,7 +58,7 @@ None by default. =head1 BUGS -Only does plain scalars and arrays. No sizes for hashes, globs, code refs, or magic scalars. Yet. +Only does plain scalars, hashes, and arrays. No sizes for globs or code refs. Yet. Also, this module currently only returns the size used by the variable itself, I the contents of arrays or hashes, nor does it follow diff --git a/Size.xs b/Size.xs index 89f0912..6f262a3 100644 --- a/Size.xs +++ b/Size.xs @@ -58,7 +58,8 @@ UV thing_size(SV *orig_thing) { total_size += SvLEN(thing); break; case SVt_PVMG: - croak("Not yet"); + total_size += sizeof(XPVMG); + total_size += SvLEN(thing); break; case SVt_PVBM: croak("Not yet"); @@ -90,7 +91,6 @@ UV thing_size(SV *orig_thing) { { HE *cur_entry; IV cur_bucket = 0; - puts("Foo!"); for (cur_bucket = 0; cur_bucket <= HvMAX(thing); cur_bucket++) { cur_entry = *(HvARRAY(thing) + cur_bucket); while (cur_entry) {