Revision history for Perl extension Devel::Size.
+0.69 2007-08-11 Tels 69 tests
+ * fix compilation under Perl v5.9.5 and v5.10 (Thanx Steve Peters!)
+ * clarify the license by specifying Perl v5.8.8's license
+ * smal doc fixes, add a README file
+
0.68 2007-06-12 Tels 69 tests
* remove a bit of duplicate code in op_size, the second instance
was a no-op anyway
MANIFEST
MANIFEST.SKIP
META.yml Module meta-data (added by MakeMaker)
+README
SIGNATURE
Size.xs
t/basic.t
# prevent this file to be added to the MANIFEST during a
#
# make manifest
+#
# command.
#
^Devel-Size.*\.tar\.gz
^MANIFEST.(bak|old)
^Size.(c|o|bs)
^blib.*
+tmon.out
+\.txt\z
Devel::Size::Report: 0.11
requires:
DynaLoader: 0
-version: 0.68
+version: 0.69
--- /dev/null
+=pod
+
+Devel::Size - Perl extension for finding the memory usage of Perl variables
+
+=head1 SYNOPSIS
+
+ use Devel::Size qw(size total_size);
+
+ my $size = size("A string");
+
+ my @foo = (1, 2, 3, 4, 5);
+ my $other_size = size(\@foo);
+
+ my $foo = {a => [1, 2, 3],
+ b => {a => [1, 3, 4]}
+ };
+ my $total_size = total_size($foo);
+
+=head1 DESCRIPTION
+
+This module figures out the real size of Perl variables in bytes, as
+accurately as possible.
+
+=head1 Build and Install
+
+To build and install this module, you need:
+
+ Perl
+ a working C or C++ compiler
+ a make (or namke on Windows) utility
+
+Follow these steps:
+
+On Linux, Cygwin, or Unix:
+
+ perl Makefile.PL
+ make
+ make test
+ sudo make install
+
+On Windows:
+
+ perl Makefile.PL
+ nmake
+ nmake test
+ nmake install
+
+=head1 BUGREPORTS
+
+Please report bugs to:
+
+ http://rt.cpan.org/NoAuth/Bugs.html?Dist=Devel-Size
+
+=head1 COPYRIGHT
+
+Copyright (C) 2005 Dan Sugalski, Copyright (C) 2007 Tels
+
+This module is free software; you can redistribute it and/or modify it
+under the same terms as Perl v5.8.8.
+
+=cut
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 ee66ae558ef004085fcfdd02cd48dbccfb03af99 CHANGES
-SHA1 b41fb799702683e35ca968f55018175c8c6298e9 MANIFEST
-SHA1 134aae6f44102ce9b0f7fa7a3710e41a0cd23646 MANIFEST.SKIP
-SHA1 b35ae97bcd1cc317531149f733fff1a2f28cfc5d META.yml
+SHA1 199e3cacd2526d5d15e48916d13b7aef6699672d CHANGES
+SHA1 e4296437ed0ab5559b250f6016d52c3b547d672e MANIFEST
+SHA1 6883c1a98abd5b1c049e389f831e939b79c13ba5 MANIFEST.SKIP
+SHA1 2ce5c32d4b38685bc3c98d46472c65632b5f204e META.yml
SHA1 6ed187e4890948dacf792b44ab18fa143a580ace Makefile.PL
-SHA1 4c4f4df3225936dc661f604629650c791af0f932 Size.xs
+SHA1 e73e2ea830b69aefd7525f73b1fc06df4bf607f5 README
+SHA1 c4c21e25262e74d0f51789302a171ea1fa93832e Size.xs
SHA1 ceac99579ef3914de1936417282842c07d907a6a inc/Module/Install.pm
SHA1 6c9471c92c28e247fb84f4ab7dc277f68b33ea95 inc/Module/Install/Base.pm
SHA1 b2cb1026330e8c4f8533c79569498ab15f189d86 inc/Module/Install/Can.pm
SHA1 80d024f3eccf1c825b02b5e59de236b0af7d4bfc inc/Module/Install/Metadata.pm
SHA1 fe6780ea5cfd67c79140699fbd4f0fe262255d57 inc/Module/Install/Win32.pm
SHA1 51d43bffcfd7ffdecb8c8e9f97f3896c31b2e1b2 inc/Module/Install/WriteAll.pm
-SHA1 97173fa2e404110c943223b095662f72acc13e5f lib/Devel/Size.pm
-SHA1 69c981fd251d8017b9602799d15a7066fcd27c5e t/basic.t
+SHA1 3a771cfbe85a36702ce8386c4dc0635bd461986c lib/Devel/Size.pm
+SHA1 b10a47370115165b080e143db320fc9873d24ce1 t/basic.t
SHA1 dc638392e64661dd07deeba11f67e35650a6384a t/pod.t
SHA1 f4ffad1e7160c51cefcd003f88e1deb1c897b344 t/pod_cov.t
-SHA1 4cafa040d3ab66402270c8b8f7f1c7308157f19c t/recurse.t
+SHA1 5cde1f755eaaf29fdffd6885764fc78dedf5d7ae t/recurse.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
-iQEVAwUBRm7/0XcLPEOTuEwVAQKEmwf+P6mE4zf9m+uH2M2avNFpoziJy58g0uUa
-D5otmranT2bXok6hALU5syPAixFzsTKnsvrdMzpIA/gtSJBNCKkBjbzaEFItw5B0
-y5D/fdA6QDpjA/2SmZGPvNwyrfy0wCcW0N6hqO8fAG4Mmvh2j8sE9JDtZVMjCQX7
-FesGUB9n/+ucj37goNk1M6f7EMSBEsdVROUNyhgicUaSdWLwfOK67M9mZIfoFadn
-DjkYQHQExtrwt/IqjKXH51gCcENJHdZ7eelTw52YHniqnh76yqXcdISQoWzpkh7i
-9kUO0Jnlk4iCS24RwRktnfiOU42+Htm41m1AUALtb0wVD3rnRZXouw==
-=xbQw
+iQEVAwUBRr8TY3cLPEOTuEwVAQLUlwf+MxR/N3qd8DCkLKrxBOlINwIifDWou6Hw
+TR+14Q1KyurpItruNGqbCKpbhJin9LdynWbbWugJy5waf3WkqCedZ+Kat2fvGoZY
+CDypeXf+9yzG23+VKpN3qsXFPemoN7g5Tbvxt2mOXauvEXcOz87agO/DxiAWyfTZ
+FVulD2f4ZqOTQZSFio/4uIxn9aqmMLHPGTjOYFKs6XnhfqsvNYtqgfR3Lc61ljGS
+WV0NnRDlwthwbttOWn+UaZdQNZMmeVNndVFPy4hBE/VoyqpWarfqvvNVq6I4v+hh
+QWfHNPLFqcauVa6E+X17rjQMuKeQ7Y+RcHg24dMbc3NvDL0um+qK3w==
+=Db+y
-----END PGP SIGNATURE-----
if (check_new(tracking_hash, cPMOPx(baseop)->op_last)) {
total_size += op_size(cPMOPx(baseop)->op_last, tracking_hash);
}
+#if PERL_VERSION < 9 || (PERL_VERSION == 9 && PERL_SUBVERSION < 5)
if (check_new(tracking_hash, cPMOPx(baseop)->op_pmreplroot)) {
total_size += op_size(cPMOPx(baseop)->op_pmreplroot, tracking_hash);
}
if (check_new(tracking_hash, cPMOPx(baseop)->op_pmnext)) {
total_size += op_size((OP *)cPMOPx(baseop)->op_pmnext, tracking_hash);
}
+#endif
/* This is defined away in perl 5.8.x, but it is in there for
5.6.x */
#ifdef PM_GETRE
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
@EXPORT = qw( );
-$VERSION = '0.68';
+$VERSION = '0.69';
bootstrap Devel::Size $VERSION;
my $foo = {a => [1, 2, 3],
b => {a => [1, 3, 4]}
};
- my $total_size = total_size($foo);
+ my $total_size = total_size($foo);
=head1 DESCRIPTION
-This module figures out the real sizes of Perl variables in bytes.
+This module figures out the real size of Perl variables in bytes, as
+accurately as possible.
+
Call functions with a reference to the variable you want the size
of. If the variable is a plain scalar it returns the size of
-the scalar. If the variable is a hash or an array, use a reference
+this scalar. If the variable is a hash or an array, use a reference
when calling.
=head1 FUNCTIONS
Copyright (C) 2005 Dan Sugalski, Copyright (C) 2007 Tels
This module is free software; you can redistribute it and/or modify it
-under the same terms as Perl itself.
+under the same terms as Perl v5.8.8.
=head1 SEE ALSO
Devel::Size->import( qw(size total_size) );
-die ("Uhoh, test uses outdated version of Devel::Size")
- unless is ($Devel::Size::VERSION, '0.68', 'VERSION MATCHES');
+die ("Uhoh, test uses an outdated version of Devel::Size")
+ unless is ($Devel::Size::VERSION, '0.69', 'VERSION MATCHES');
#############################################################################
# some basic checks:
Devel::Size->import( qw(size total_size) );
-die ("Uhoh, test uses outdated version of Devel::Size")
- unless is ($Devel::Size::VERSION, '0.68', 'VERSION MATCHES');
+die ("Uhoh, test uses an outdated version of Devel::Size")
+ unless is ($Devel::Size::VERSION, '0.69', 'VERSION MATCHES');
#############################################################################
# verify that pointer sizes in array slots are sensible: