Nicholas Clark [Sun, 17 Apr 2011 15:28:00 +0000]
This is 0.73_51 - update META.yml
Nicholas Clark [Sun, 17 Apr 2011 15:13:55 +0000]
check_new() is now never called with NULL st, so simplify it slightly.
Nicholas Clark [Sun, 17 Apr 2011 15:12:04 +0000]
Add check_new_and_strlen(), which is check_new(...) && total_size += strlen(...)
This removes an oft-repeated pattern.
Nicholas Clark [Sun, 17 Apr 2011 15:01:07 +0000]
check_new(st, NULL) always returns 0, so no need to check NULL before calling it
Nicholas Clark [Sun, 17 Apr 2011 13:06:42 +0000]
Move the check_new() test to the start of regex_size(). All 1 caller uses it.
Nicholas Clark [Sun, 17 Apr 2011 13:01:08 +0000]
Move the check_new() test to the start of op_size(). All callers used it.
This reduces the amount of repetition in the source code. Whilst it likely will
cause one extra level of function calling at runtime (for a "seen before" OP,
as op_size() now needs to be entered), it will reduce object code size, which
will compensate. Not measured the difference, but expect it all to be dwarfed
anyway by cache misses on data reads. Maintainability wins.
Also as these are major changes, reindent all sections of op_size() which have
changed.
Nicholas Clark [Sun, 17 Apr 2011 12:34:02 +0000]
Refactor the C code to accumulate the size inside the tracking structure
The C *_size() functions now return void. Mark all as static.
The XS functions size() and total_size() now return UV, not IV.
Nicholas Clark [Sun, 17 Apr 2011 12:11:51 +0000]
Eliminate conditional 5.11/older conditional code that is actually unnecessary.
Need to use SvRV_const() for const correctness, which isn't in ppport.h, so
provide our own fallback definition when needed.
The logic used for pre-5.11 is (locally) correct for post 5.11 too.
However, the intent of the *design* of the module is that references never get
into this part of the code. Unfortunately, in turn, the implementation of the
design isn't right, and they do. However, the fix for this is actually to fix
the design, because it too isn't right.
Nicholas Clark [Sun, 17 Apr 2011 12:07:34 +0000]
Remove dead code: #if PERL_VERSION <= 8 then PERL_VERSION is definitely < 11.
Nicholas Clark [Sun, 17 Apr 2011 09:52:10 +0000]
Bump $VERSION to 0.73_51
Nicholas Clark [Sun, 17 Apr 2011 09:49:57 +0000]
Missed the second change between 0.73 and 0.73_50
This is significant, as the pair of changes should address all test smoke
failures. Fingers crossed.
Nicholas Clark [Sun, 17 Apr 2011 09:47:40 +0000]
This is 0.73_50 - update META.yml
Nicholas Clark [Sun, 17 Apr 2011 09:28:37 +0000]
Re-instate initial dereference in total_size()
We most definitely can push an AV or an HV onto the pending array. Despite
having a comment saying that we can't do that, that was exactly what the
previous code *was* doing, only within the switch statement.
Previously, this code:
my $a = [];
my $b = \$a;
weaken $b;
total_size($a)
was returning a value which happened to be the size of the magic structure
(but not the object hanging from it - fixme) due to the interaction of two
different bugs. The number it pulled out of its backside was
thing_size(rv, st) - thing_size(rv, NULL), where thing_size(...) called
magic_size(...), and that returned 0 always if the st parameter was NULL,
because check_new(st, p) always returns FALSE (ie not new) if the first
parameter is NULL. Good eh?)
Nicholas Clark [Sun, 17 Apr 2011 08:36:54 +0000]
Avoid using assert() on ithreaded 5.8.8 and earlier, as it needs my_perl
Nicholas Clark [Sun, 17 Apr 2011 08:23:45 +0000]
Bump $VERSION to 0.73_50
Nicholas Clark [Sat, 16 Apr 2011 16:31:31 +0000]
This is 0.73 - update META.yml
Nicholas Clark [Sat, 16 Apr 2011 06:41:12 +0000]
Update CHANGES for 0.73
Correct the year 2111 to 2011 in two previous entries.
Nicholas Clark [Sat, 16 Apr 2011 06:31:10 +0000]
Bump version to 0.73
Nicholas Clark [Fri, 15 Apr 2011 20:38:03 +0000]
Revert the intent of
cb11131e. st (was tv) can be NULL.
There's (currently) a call to thing_size() with a NULL st early in total_size().
None of the existing tests caused a code path to be followed that reaches the
assertion, so add one that does.
Nicholas Clark [Sat, 16 Apr 2011 15:41:48 +0000]
This is 0.72_52 - update META.yml
Nicholas Clark [Fri, 15 Apr 2011 15:11:25 +0000]
Replace TRACKING with struct state, tv with st, and rename {new,free}_tracking()
Nicholas Clark [Fri, 15 Apr 2011 15:07:12 +0000]
Merge the 4 static variables and TRACKING into a struct state.
Add a new static function new_tracking(), to mirror free_tracking().
Nicholas Clark [Fri, 15 Apr 2011 15:03:58 +0000]
Add a test for the non-exceptional warnings.
Requires Test::PerlRun, which doesn't yet exist on CPAN. Otherwise it skips.
Nicholas Clark [Fri, 15 Apr 2011 13:22:09 +0000]
Use cmp_ok() when testing > 0, not isnt(..., 0);
Nicholas Clark [Fri, 15 Apr 2011 13:16:22 +0000]
Eliminate needless test boilerplate, and duplicated effort.
There's no need to change directory or duplicate the effects of -Mblib.
Let use do the importing, rather than an explicit import call.
use_ok() is arguably harmful - just let the use fail and take the entire test
out cleanly, rather than carrying on and generating meaningless failures.
No need to test ->can() and $VERSION in both - once is sufficient.
Nicholas Clark [Fri, 15 Apr 2011 12:43:23 +0000]
Simplify the setup code in Size.pm
We don't use @EXPORT, so don't mention it. As the only tag is :all, declare
@EXPORT_OK first, and define %EXPORT_TAGS in terms of it.
Nicholas Clark [Fri, 15 Apr 2011 12:40:45 +0000]
Bump $VERSION to 0.72_52
Nicholas Clark [Sat, 16 Apr 2011 15:38:20 +0000]
This is 0.72_51 - update META.yml
Nicholas Clark [Fri, 15 Apr 2011 09:11:47 +0000]
Add PERL_NO_GET_CONTEXT to improve performance under multiplicity.
Add pTHX_ to thing_size() and op_size(). Also change both to static.
Nicholas Clark [Fri, 15 Apr 2011 08:43:26 +0000]
Remove the SIGNATURE, as presently I don't have the capability to sign dists.
The SIGNATURE file was from the 0.71 release, so was already rather stale.
Nicholas Clark [Thu, 14 Apr 2011 22:22:35 +0000]
Add the .git repository directory to MANIFEST.SKIP
Nicholas Clark [Thu, 14 Apr 2011 21:58:33 +0000]
Add a LICENSE section to the Makefile.PL.
Nicholas Clark [Thu, 14 Apr 2011 20:43:39 +0000]
Bump $VERSION to 0.72_51
Nicholas Clark [Sat, 16 Apr 2011 15:34:50 +0000]
This is 0.72_50 - update META.yml
Nicholas Clark [Thu, 14 Apr 2011 19:59:01 +0000]
Convert C99 // comments to C89 /**/ comments.
On some platforms, the only compilers are dogmatically C89.
Remove the comment '?try', presumably a reference to a possible place to use
__try/__except. There's something seriously wrong with the internal's data
structures if the chain of magic pointers is corrupt - carrying on silently
isn't a great idea.
Nicholas Clark [Thu, 14 Apr 2011 19:58:03 +0000]
Remove commented out code from the pre-0.72 HV based tracking system.
Nicholas Clark [Thu, 14 Apr 2011 19:31:15 +0000]
Include the size of constants in constant subs (resolves CPAN #58485)
Nicholas Clark [Thu, 14 Apr 2011 19:29:59 +0000]
Resolve CPAN #58484: Devel::Size SEGVs on XSUBs post 5.9.4
Nicholas Clark [Thu, 14 Apr 2011 19:14:55 +0000]
Note that I am now maintaining it.
Clarify that BrowserUK wrote the version of the pointer tracking for 0.72.
0.73's version has been somewhat refactored by me. (So blame me for the bugs.)
Nicholas Clark [Thu, 14 Apr 2011 19:08:22 +0000]
Enforce the minimum perl version requirement in the Makefile.PL
This inform CPAN smokers to skip testing on earlier perl versions.
Nicholas Clark [Thu, 14 Apr 2011 19:06:56 +0000]
Convert to XSLoader.
Nicholas Clark [Thu, 14 Apr 2011 18:54:34 +0000]
Convert the tracking system to a 256-way tree.
This avoids needing to make compiled-in assumptions about the memory map on 64
bit systems, which in turn means all the code and documentation relating to
that, and how to recompile if the assumptions fail, can go.
Nicholas Clark [Thu, 14 Apr 2011 17:39:48 +0000]
Create free_tracking() to de-duplicate the code to free the tracking structure.
Nicholas Clark [Thu, 14 Apr 2011 17:23:23 +0000]
Use cmp_ok() in place of ok() with a < comparison, for better diagnostics.
Eliminate an unused lexical $tests.
Nicholas Clark [Thu, 14 Apr 2011 15:54:30 +0000]
In check_new(), tv can never be NULL, so assert() this.
This will simplify future refactoring.
Nicholas Clark [Thu, 14 Apr 2011 15:49:08 +0000]
Use SvPVX_const() instead of SvPVX(), and const check_new().
Also change check_new()'s return type to bool, as it only returns TRUE or FALSE,
and declare it static.
Without the consting, under -DDEBUGGING, the macro for SvPVX() assigns thing,
which is const SV *, to a void *, which elicits a legitimate compiler warning.
In turn, the return value of SvPVX_const() is const char *, which means that
check_new() needs to properly declare its parameter p as const void *.
Nicholas Clark [Thu, 14 Apr 2011 13:19:15 +0000]
Catching SEGVs with __try/__except is MSVC only, not general C++
__try/__except is an MSVC extension to C++ *and* C, and is orthogonal to
"regular" C++ exception handling. As there's no way to catch a SEGV with
C++ exceptions (certainly not portably), and __try/__except is available in C,
there's nothing to be gained from using C++ exceptions, and hence making the
code require a C++ compiler. Hence remove the logic from Makefile.PL to force
compilation with a C++ compiler, which didn't even work well on "both" kinds of
OS, as it assumed that the C compiler was named *exactly* qr/\Ag?cc\z/, and
that the analogous C++ compiler was available and named g++.
[Which isn't true when it's named 'ccache gcc', 'gcc-mp-4.6' etc, or when cc
isn't gcc]
Nicholas Clark [Thu, 14 Apr 2011 10:35:20 +0000]
No need to explicitly check AvARYLEN in 5.10 and later.
In 5.10 the struct slot was eliminated, and contents are now stored in magic,
which will already be found. Whilst there's no direct "harm" in looking again,
as the "seen" tracker will skip the second discovery, it's wasteful, and now
generates a compilation error, as AvARYLEN() expects a mutable pointer, whereas
the variable thing is const void *.
This also resolves CPAN RT #49437 - Devel::Size adds magic in Perl 5.10
Nicholas Clark [Thu, 14 Apr 2011 18:59:59 +0000]
Bump $VERSION to 0.72_50, ready for a development release.
Nicholas Clark [Thu, 14 Apr 2011 13:17:22 +0000]
Correct to 0.72 the CHANGES entry for the second "0.71".
Nicholas Clark [Thu, 14 Apr 2011 13:04:43 +0000]
Correct to 0.72 erroneous references to version '7.2'.
Nicholas Clark [Thu, 14 Apr 2011 12:15:18 +0000]
Remove DOS line endings from Makefile.PL and META.yml
BrowserUk [Fri, 24 Oct 2008 21:28:13 +0000]
import Devel-Size 0.72 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.72
git-cpan-authorid: BROWSERUK
git-cpan-file: authors/id/B/BR/BROWSERUK/Devel-Size-0.72.tar.gz
Tels [Sun, 24 Aug 2008 12:49:33 +0000]
import Devel-Size 0.71 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.71
git-cpan-authorid: TELS
git-cpan-file: authors/id/T/TE/TELS/devel/Devel-Size-0.71.tar.gz
Tels [Sat, 16 Apr 2011 13:49:20 +0000]
0.70 as released to CPAN. (only metadata and Module::Install changes)
Module::Install upgraded to 0.77 from 0.71
Tels [Sat, 16 Apr 2011 13:22:05 +0000]
Fix compilation under blead, and require at least 5.006
Compilation fix from Reini Urban.
Also, upgrade Module::Install to 0.71 from 0.68, and regenerate SIGNATURE.
Tels [Sat, 16 Apr 2011 13:17:37 +0000]
Bump version to 0.70, and upgrade Module::Install to 0.88 from 0.85
SIGNATURES has not been updated, hence changed files will fail the signature
test.
Tels [Sun, 12 Aug 2007 14:05:37 +0000]
import Devel-Size 0.69 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.69
git-cpan-authorid: TELS
git-cpan-file: authors/id/T/TE/TELS/devel/Devel-Size-0.69.tar.gz
Tels [Tue, 12 Jun 2007 20:22:30 +0000]
import Devel-Size 0.68 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.68
git-cpan-authorid: TELS
git-cpan-file: authors/id/T/TE/TELS/devel/Devel-Size-0.68.tar.gz
Tels [Thu, 15 Mar 2007 18:06:32 +0000]
import Devel-Size 0.67 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.67
git-cpan-authorid: TELS
git-cpan-file: authors/id/T/TE/TELS/devel/Devel-Size-0.67.tar.gz
Tels [Fri, 2 Mar 2007 16:38:01 +0000]
import Devel-Size 0.66 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.66
git-cpan-authorid: TELS
git-cpan-file: authors/id/T/TE/TELS/devel/Devel-Size-0.66.tar.gz
Tels [Sat, 24 Feb 2007 10:24:36 +0000]
import Devel-Size 0.65 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.65
git-cpan-authorid: TELS
git-cpan-file: authors/id/T/TE/TELS/devel/Devel-Size-0.65.tar.gz
Dan Sugalski [Mon, 19 Dec 2005 23:51:47 +0000]
import Devel-Size 0.64 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.64
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.64.tar.gz
Dan Sugalski [Fri, 1 Jul 2005 16:43:17 +0000]
import Devel-Size 0.63 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.63
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.63.tar.gz
Dan Sugalski [Tue, 28 Jun 2005 16:01:59 +0000]
import Devel-Size 0.62 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.62
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.62.tar.gz
Dan Sugalski [Mon, 27 Jun 2005 20:24:51 +0000]
import Devel-Size 0.61 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.61
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.61.tar.gz
Dan Sugalski [Mon, 27 Jun 2005 20:06:45 +0000]
import Devel-Size 0.60 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.60
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.60.tar.gz
Dan Sugalski [Sat, 27 Nov 2004 21:45:06 +0000]
import Devel-Size 0.59 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.59
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.59.tar.gz
Dan Sugalski [Fri, 18 Jul 2003 16:56:24 +0000]
import Devel-Size 0.58 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.58
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.58.tar.gz
Dan Sugalski [Thu, 20 Mar 2003 18:15:45 +0000]
import Devel-Size 0.57 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.57
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.57.tar.gz
Dan Sugalski [Mon, 24 Feb 2003 16:44:26 +0000]
import Devel-Size 0.56 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.56
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.56.tar.gz
Dan Sugalski [Sun, 23 Feb 2003 17:03:51 +0000]
import Devel-Size 0.55 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.55
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.55.tar.gz
Dan Sugalski [Sat, 12 Oct 2002 18:14:42 +0000]
import Devel-Size 0.54 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.54
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.54.tar.gz
Dan Sugalski [Thu, 10 Oct 2002 19:34:33 +0000]
import Devel-Size 0.53 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.53
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.53.tar.gz
Dan Sugalski [Thu, 10 Oct 2002 04:11:06 +0000]
import Devel-Size 0.52 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.52
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.52.tar.gz
Dan Sugalski [Wed, 9 Oct 2002 18:48:27 +0000]
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
Dan Sugalski [Wed, 9 Oct 2002 17:28:49 +0000]
import Devel-Size 0.50 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.50
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.50.tar.gz
Dan Sugalski [Tue, 8 Oct 2002 18:04:15 +0000]
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
Dan Sugalski [Tue, 8 Oct 2002 17:53:32 +0000]
import Devel-Size 0.02 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.02
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.02.tar.gz
Dan Sugalski [Tue, 8 Oct 2002 06:23:43 +0000]
initial import of Devel-Size 0.01 from CPAN
git-cpan-module: Devel-Size
git-cpan-version: 0.01
git-cpan-authorid: DSUGAL
git-cpan-file: authors/id/D/DS/DSUGAL/Devel-Size-0.01.tar.gz