12 years agoCorrectly handle SvOOK scalars. 5.12 and later don't use SvIVX().
Nicholas Clark [Fri, 6 May 2011 19:29:18 +0000]
Correctly handle SvOOK scalars. 5.12 and later don't use SvIVX().

12 years agoppport.h defined NV if necessary, so no need to duplicate that.
Nicholas Clark [Fri, 6 May 2011 19:16:19 +0000]
ppport.h defined NV if necessary, so no need to duplicate that.

12 years agoAdd -DPURIFY sizes to body_sizes[]
Nicholas Clark [Fri, 6 May 2011 19:07:10 +0000]
Add -DPURIFY sizes to body_sizes[]

Use two macros to simplify the logic - MAYBE_OFFSET() where the normal version
subtracts a STRUCT_OFFSET(), and the purify version subtracts nothing, and
MAYBE_PURIFY() where there is not a simple relationship between the two sizes.

12 years agoUse a table for SV body sizes. These incorporate the space saving post 5.8.x
Nicholas Clark [Thu, 5 May 2011 16:04:36 +0000]
Use a table for SV body sizes. These incorporate the space saving post 5.8.x

For now, the sizes under -DPURIFY aren't correct.

12 years agoIn sv_size(), refactor the PV-derivatives to share as much code as possible.
Nicholas Clark [Thu, 5 May 2011 11:45:10 +0000]
In sv_size(), refactor the PV-derivatives to share as much code as possible.

As a side effect, PV"BM"s are now handled correctly on 5.10.0 and later.

12 years agoIn sv_size(), coalesce all calls to magic_size().
Nicholas Clark [Thu, 5 May 2011 09:50:44 +0000]
In sv_size(), coalesce all calls to magic_size().

12 years agoBump $VERSION to 0.75_52
Nicholas Clark [Thu, 5 May 2011 09:15:51 +0000]
Bump $VERSION to 0.75_52

12 years agoThis is 0.75_51 - update META.yml
Nicholas Clark [Thu, 5 May 2011 09:14:23 +0000]
This is 0.75_51 - update META.yml

12 years agoFor other-than-gcc, generate calls to check_new(...)
Nicholas Clark [Thu, 5 May 2011 09:00:07 +0000]
For other-than-gcc, generate calls to check_new(...)

Only use a static array of vtables on gcc. Some other compilers may be happy
with it, but VC certainly isn't. It's only trivial to determine gcc or not.

12 years agoBump $VERSION to 0.75_51
Nicholas Clark [Thu, 5 May 2011 08:24:30 +0000]
Bump $VERSION to 0.75_51

12 years agoThis is 0.75_50 - update META.yml
Nicholas Clark [Thu, 5 May 2011 08:21:20 +0000]
This is 0.75_50 - update META.yml

12 years agoeval $ExtUtils::MakeMaker::VERSION to avoid warnings about _ not being numeric.
Nicholas Clark [Wed, 4 May 2011 20:41:45 +0000]
eval $ExtUtils::MakeMaker::VERSION to avoid warnings about _ not being numeric.

Frustratingly ExtUtils::MakeMaker->VERSION() returns the literal value of
$ExtUtils::MakeMaker::VERSION so it's just as "not numeric" as reading the
scalar directly.

12 years agoRe-indent Makefile.PL consistently.
Nicholas Clark [Wed, 4 May 2011 20:41:00 +0000]
Re-indent Makefile.PL consistently.

12 years agoSimplify magic_size() by knowing that check_new() returns false for NULL.
Nicholas Clark [Wed, 4 May 2011 20:37:24 +0000]
Simplify magic_size() by knowing that check_new() returns false for NULL.

12 years agoAdd the size of mg_len if mg_ptr is non-NULL.
Nicholas Clark [Wed, 4 May 2011 20:24:58 +0000]
Add the size of mg_len if mg_ptr is non-NULL.

With special cases for UTF-8 caching magic, which abuses mg_len, and for
mg_len == HEf_SVKEY

12 years agoFollow mg_obj, which points to an SV.
Nicholas Clark [Wed, 4 May 2011 19:18:39 +0000]
Follow mg_obj, which points to an SV.

12 years agoAdd tests for sizing magic.
Nicholas Clark [Wed, 4 May 2011 19:14:43 +0000]
Add tests for sizing magic.

12 years agoThe core's magic vtables are global constants, so aren't part of the size.
Nicholas Clark [Wed, 4 May 2011 18:41:54 +0000]
The core's magic vtables are global constants, so aren't part of the size.

Parse perl.h to find the names of the vtables' names, and generate code to add
them all in new_state() as "seen".

12 years agoBump $VERSION to 0.75_50
Nicholas Clark [Wed, 4 May 2011 16:10:22 +0000]
Bump $VERSION to 0.75_50

12 years agoThis is 0.75 - update META.yml
Nicholas Clark [Wed, 4 May 2011 15:23:39 +0000]
This is 0.75 - update META.yml

12 years agoBump $VERSION to 0.75
Nicholas Clark [Wed, 4 May 2011 15:06:21 +0000]
Bump $VERSION to 0.75

12 years agoThis is 0.74_53 - update META.yml
Nicholas Clark [Wed, 4 May 2011 15:00:30 +0000]
This is 0.74_53 - update META.yml

12 years agoSkip the aelemfast size comparison test for perls which predate the code change.
Nicholas Clark [Sun, 1 May 2011 21:24:07 +0000]
Skip the aelemfast size comparison test for perls which predate the code change.

It was merged to maint-5.8 between 5.8.3 and 5.8.4, so 5.8.4 and later have it.
For 5.8.3 and earlier, the assumptions the test makes about sizes (based on op
structure) are bogus.

12 years agoSkip GvFILE on ithreaded 5.8.8 and earlier, as it can point to freed memory.
Nicholas Clark [Sun, 1 May 2011 21:02:59 +0000]
Skip GvFILE on ithreaded 5.8.8 and earlier, as it can point to freed memory.

Probably better to slightly under report sizes, than report something random or
SEGV.

12 years agoSet the pointer alignment (in bits) via a C macro generated by the Makefile.PL
Nicholas Clark [Sun, 1 May 2011 20:06:51 +0000]
Set the pointer alignment (in bits) via a C macro generated by the Makefile.PL

The previous approach of using sizeof(void *) is flat out wrong on a 64 bit
system. The right answer is 3. It gives 4. Which isn't a problem once the
pointer rotation code in check_new() isn't buggy, but isn't as efficient as
desired.

12 years agoFix typo error in bit-vector tracking mechanism, causing bogus "seen before"s.
Nicholas Clark [Sun, 1 May 2011 19:56:48 +0000]
Fix typo error in bit-vector tracking mechanism, causing bogus "seen before"s.

On 64 bit platforms which allocate on 8 byte alignment (rather than 16), a low
pointer bit could get lost, resulting in new pointers being considered already
"seen". Joy, hilarity, failing tests and different results running under gdb.
"Found" by BinGOs' smoker, fixed on spectre.mongueurs.net. The help was
appreciated.

12 years agoBump $VERSION to 0.74_53
Nicholas Clark [Sun, 1 May 2011 19:51:58 +0000]
Bump $VERSION to 0.74_53

12 years agoThis is 0.74_52 - update META.yml
Nicholas Clark [Mon, 25 Apr 2011 08:50:28 +0000]
This is 0.74_52 - update META.yml

12 years agoSvOK() && SvROK() is a tautology - SvROK() true has always implied SvOK() true.
Nicholas Clark [Sun, 24 Apr 2011 21:07:24 +0000]
SvOK() && SvROK() is a tautology - SvROK() true has always implied SvOK() true.

So no need to check SvOK() first on 5.10 or earlier.

12 years agototal_size() and size() can be XS ALIASes, now all the logic is in sv_size()
Nicholas Clark [Sun, 24 Apr 2011 20:59:00 +0000]
total_size() and size() can be XS ALIASes, now all the logic is in sv_size()

12 years agoMove iteration over array values from total_size() to sv_size()
Nicholas Clark [Sun, 24 Apr 2011 20:51:52 +0000]
Move iteration over array values from total_size() to sv_size()

For now this requires some bodgery over when array values should be recursed
into. Arrays presented to total_size() should be properly recursed into.
However, historically the inner arrays of padlists were never traversed, which
means there is no code to deal with the special case rules for them. So to avoid
the perfect being the enemy of the good, defer writing that code, by skipping
the inner arrays of padlists for now.

12 years agoHandle sizes for PVGVs in sv_size() only.
Nicholas Clark [Sun, 24 Apr 2011 20:39:18 +0000]
Handle sizes for PVGVs in sv_size() only.

Previously the logic was duplicated in total_size().

12 years agoMove iteration over hash values from total_size() to sv_size()
Nicholas Clark [Sun, 24 Apr 2011 15:32:40 +0000]
Move iteration over hash values from total_size() to sv_size()

For now this requires some bodgery over when hash values should be recursed
into. Hashes presented to total_size() should be properly recursed into, else
the size of symbol tables isn't correctly reported. However, the back-link
from a CV to its stash shouldn't be traversed, as shouldn't GVs referenced from
OPs, else we run the risk of passing through %::, and adding the size of all
the symbol tables (and subroutines) to the size of a subroutine reference we
were directly passed. Whilst this might be useful in some cases, it isn't useful
as a default, and it isn't even vaguely consistent with the sizes total_size()
historically reported.

12 years agoFix potential SEGVs for PVBMs on 5.10.0 and later.
Nicholas Clark [Sun, 24 Apr 2011 19:45:25 +0000]
Fix potential SEGVs for PVBMs on 5.10.0 and later.

5.10.0 stores PVBMs as PVGVs. Hence not all PVGVs are typeglobs, and XS code
should check isGV_with_GP() is true before performing typeglob lookups.

The PVGV code currently ignores SvCUR()/SvLEN(), so for now the size of PVBMs
is under-reported on 5.10.0 and later.

12 years agoThe optree holds pointers to GVs under multiplicity. It's ithreads that differs.
Nicholas Clark [Sun, 24 Apr 2011 17:43:32 +0000]
The optree holds pointers to GVs under multiplicity. It's ithreads that differs.

Hence the tests that are conditional on the different behaviours should be
{unthreaded,multiplicity} vs {ithreads}, not
{unthreaded} vs {multiplicity,ithreads}

12 years agoIn op_size, add break statement missing for OPc_PVOP.
Nicholas Clark [Sat, 23 Apr 2011 20:55:48 +0000]
In op_size, add break statement missing for OPc_PVOP.

This has been missing since op_size was added in 0.60. Without it, PVOPs would
run on into the OPc_LOOP case, which would likely SEGV as it would consider
the char *op_pv as OP *op_first, and non-existent op_last, op_redoop, op_nextop
and op_lastop.

12 years agoFix potential SEGVs for OP_AELEMFAST on a lexical.
Nicholas Clark [Sat, 23 Apr 2011 20:07:10 +0000]
Fix potential SEGVs for OP_AELEMFAST on a lexical.

OP_AELEMFAST is wonderfully special, in that it can be used to replace both
OP_GV and OP_PADAV. The latter is only a baseop, whereas OP_AELEMFAST is a
flagged as a padop/svop. baseops are smaller, and (therefore) don't have memory
allocated where op_sv "should" be.

12 years agoAdd tests for subroutines and subroutine references.
Nicholas Clark [Sat, 23 Apr 2011 17:48:36 +0000]
Add tests for subroutines and subroutine references.

12 years agoBump $VERSION to 0.74_52
Nicholas Clark [Sun, 24 Apr 2011 21:02:44 +0000]
Bump $VERSION to 0.74_52

12 years agoThis is 0.74_51 - update META.yml
Nicholas Clark [Fri, 22 Apr 2011 16:43:36 +0000]
This is 0.74_51 - update META.yml

12 years agoFix classic off-by-one error - the answer is strlen() + 1, not just strlen()
Nicholas Clark [Fri, 22 Apr 2011 16:30:03 +0000]
Fix classic off-by-one error - the answer is strlen() + 1, not just strlen()

This has been in the code since year dot, and no-one has spotted that the
returned sizes have been under-reporting.

12 years agoMove the check_new() test to the start of sv_size()
Nicholas Clark [Thu, 21 Apr 2011 11:19:08 +0000]
Move the check_new() test to the start of sv_size()

For now, this requires sv_size() to return new-or-not, but it prepares the way
to move all structure recursion into sv_size(). Currently it's in two places -
sv_size() and total_size().

This resolves two long-standing bugs in typeglobs - total_size() was double
counting entries in typeglobs, and sv_size() was double-counting the PVGV size
if GvEGV() looped back.

12 years agoAdd many tests for typeglobs.
Nicholas Clark [Fri, 22 Apr 2011 11:26:33 +0000]
Add many tests for typeglobs.

These reveal several bugs.

13 years agoDon't count PL_sv_{undef,no,yes} in the size returned
Nicholas Clark [Mon, 18 Apr 2011 10:21:53 +0000]
Don't count PL_sv_{undef,no,yes} in the size returned

PL_sv_{undef,no,yes} are singletons, interpreter wide, so shouldn't count as
part of the size.

13 years agoBump $VERSION to 0.74_51
Nicholas Clark [Tue, 19 Apr 2011 20:13:37 +0000]
Bump $VERSION to 0.74_51

13 years agoThis is 0.74_50 - update META.yml
Nicholas Clark [Tue, 19 Apr 2011 20:12:11 +0000]
This is 0.74_50 - update META.yml

13 years agoEnsure that size() doesn't add the referent's size for non SVt_RV references.
Nicholas Clark [Tue, 19 Apr 2011 10:17:12 +0000]
Ensure that size() doesn't add the referent's size for non SVt_RV references.

Previously it was adding the referent's size if the reference happened to be
other-than-SVt_RV (ie a blessed reference, or a reference assigned to a
previously used variable).

This requires stopping thing_size() from recursing into references when called
from size(). So add a boolean parameter controlling whether to recurse. As this
means changing every call to it, also rename it to sv_size(), and re-order the
parameters so that struct state is first.

13 years agoTest that unallocated gaps within arrays have zero size.
Nicholas Clark [Mon, 18 Apr 2011 11:12:37 +0000]
Test that unallocated gaps within arrays have zero size.

This gets to be a bit more complex than it would first seem, as Test::More's
is_deeply() gets the length of arrays using $#array syntax, and that operation
allocates structures within the array prior to 5.12. We can't use
stringification, as we need to test undefs, so roll our own minimal test
subroutine.

13 years agoBump $VERSION to 0.74_50
Nicholas Clark [Tue, 19 Apr 2011 19:57:36 +0000]
Bump $VERSION to 0.74_50

13 years agoThis is 0.74 - update META.yml
Nicholas Clark [Tue, 19 Apr 2011 19:55:39 +0000]
This is 0.74 - update META.yml

13 years agoLICENSE was added to ExtUtils::MakeMaker in 6.31, not 6.30
Nicholas Clark [Sun, 17 Apr 2011 16:38:29 +0000]
LICENSE was added to ExtUtils::MakeMaker in 6.31, not 6.30

13 years agoBump $VERSION to 0.74
Nicholas Clark [Sun, 17 Apr 2011 15:28:55 +0000]
Bump $VERSION to 0.74

13 years agoThis is 0.73_51 - update META.yml
Nicholas Clark [Sun, 17 Apr 2011 15:28:00 +0000]
This is 0.73_51 - update META.yml

13 years agocheck_new() is now never called with NULL st, so simplify it slightly.
Nicholas Clark [Sun, 17 Apr 2011 15:13:55 +0000]
check_new() is now never called with NULL st, so simplify it slightly.

13 years agoAdd check_new_and_strlen(), which is check_new(...) && total_size += strlen(...)
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.

13 years agocheck_new(st, NULL) always returns 0, so no need to check NULL before calling it
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

13 years agoMove the check_new() test to the start of regex_size(). All 1 caller uses 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.

13 years agoMove the check_new() test to the start of op_size(). All callers used 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.

13 years agoRefactor the C code to accumulate the size inside the tracking structure
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.

13 years agoEliminate conditional 5.11/older conditional code that is actually unnecessary.
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.

13 years agoRemove dead code: #if PERL_VERSION <= 8 then PERL_VERSION is definitely < 11.
Nicholas Clark [Sun, 17 Apr 2011 12:07:34 +0000]
Remove dead code: #if PERL_VERSION <= 8 then PERL_VERSION is definitely < 11.

13 years agoBump $VERSION to 0.73_51
Nicholas Clark [Sun, 17 Apr 2011 09:52:10 +0000]
Bump $VERSION to 0.73_51

13 years agoMissed the second change between 0.73 and 0.73_50
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.

13 years agoThis is 0.73_50 - update META.yml
Nicholas Clark [Sun, 17 Apr 2011 09:47:40 +0000]
This is 0.73_50 - update META.yml

13 years agoRe-instate initial dereference in total_size()
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?)

13 years agoAvoid using assert() on ithreaded 5.8.8 and earlier, as it needs my_perl
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

13 years agoBump $VERSION to 0.73_50
Nicholas Clark [Sun, 17 Apr 2011 08:23:45 +0000]
Bump $VERSION to 0.73_50

13 years agoThis is 0.73 - update META.yml
Nicholas Clark [Sat, 16 Apr 2011 16:31:31 +0000]
This is 0.73 - update META.yml

13 years agoUpdate CHANGES for 0.73
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.

13 years agoBump version to 0.73
Nicholas Clark [Sat, 16 Apr 2011 06:31:10 +0000]
Bump version to 0.73

13 years agoRevert the intent of cb11131e. st (was tv) can be NULL.
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.

13 years agoThis is 0.72_52 - update META.yml
Nicholas Clark [Sat, 16 Apr 2011 15:41:48 +0000]
This is 0.72_52 - update META.yml

13 years agoReplace TRACKING with struct state, tv with st, and rename {new,free}_tracking()
Nicholas Clark [Fri, 15 Apr 2011 15:11:25 +0000]
Replace TRACKING with struct state, tv with st, and rename {new,free}_tracking()

13 years agoMerge the 4 static variables and TRACKING into a struct state.
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().

13 years agoAdd a test for the non-exceptional warnings.
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.

13 years agoUse cmp_ok() when testing > 0, not isnt(..., 0);
Nicholas Clark [Fri, 15 Apr 2011 13:22:09 +0000]
Use cmp_ok() when testing > 0, not isnt(..., 0);

13 years agoEliminate needless test boilerplate, and duplicated effort.
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.

13 years agoSimplify the setup code in Size.pm
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.

13 years agoBump $VERSION to 0.72_52
Nicholas Clark [Fri, 15 Apr 2011 12:40:45 +0000]
Bump $VERSION to 0.72_52

13 years agoThis is 0.72_51 - update META.yml
Nicholas Clark [Sat, 16 Apr 2011 15:38:20 +0000]
This is 0.72_51 - update META.yml

13 years agoAdd PERL_NO_GET_CONTEXT to improve performance under multiplicity.
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.

13 years agoRemove the SIGNATURE, as presently I don't have the capability to sign dists.
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.

13 years agoAdd the .git repository directory to MANIFEST.SKIP
Nicholas Clark [Thu, 14 Apr 2011 22:22:35 +0000]
Add the .git repository directory to MANIFEST.SKIP

13 years agoAdd a LICENSE section to the Makefile.PL.
Nicholas Clark [Thu, 14 Apr 2011 21:58:33 +0000]
Add a LICENSE section to the Makefile.PL.

13 years agoBump $VERSION to 0.72_51
Nicholas Clark [Thu, 14 Apr 2011 20:43:39 +0000]
Bump $VERSION to 0.72_51

13 years agoThis is 0.72_50 - update META.yml
Nicholas Clark [Sat, 16 Apr 2011 15:34:50 +0000]
This is 0.72_50 - update META.yml

13 years agoConvert C99 // comments to C89 /**/ comments.
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.

13 years agoRemove commented out code from the pre-0.72 HV based tracking system.
Nicholas Clark [Thu, 14 Apr 2011 19:58:03 +0000]
Remove commented out code from the pre-0.72 HV based tracking system.

13 years agoInclude the size of constants in constant subs (resolves CPAN #58485)
Nicholas Clark [Thu, 14 Apr 2011 19:31:15 +0000]
Include the size of constants in constant subs (resolves CPAN #58485)

13 years agoResolve CPAN #58484: Devel::Size SEGVs on XSUBs post 5.9.4
Nicholas Clark [Thu, 14 Apr 2011 19:29:59 +0000]
Resolve CPAN #58484: Devel::Size SEGVs on XSUBs post 5.9.4

13 years agoNote that I am now maintaining it.
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.)

13 years agoEnforce the minimum perl version requirement in the Makefile.PL
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.

13 years agoConvert to XSLoader.
Nicholas Clark [Thu, 14 Apr 2011 19:06:56 +0000]
Convert to XSLoader.

13 years agoConvert the tracking system to a 256-way tree.
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.

13 years agoCreate free_tracking() to de-duplicate the code to free the tracking structure.
Nicholas Clark [Thu, 14 Apr 2011 17:39:48 +0000]
Create free_tracking() to de-duplicate the code to free the tracking structure.

13 years agoUse cmp_ok() in place of ok() with a < comparison, for better diagnostics.
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.

13 years agoIn check_new(), tv can never be NULL, so assert() this.
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.

13 years agoUse SvPVX_const() instead of SvPVX(), and const check_new().
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 *.

13 years agoCatching SEGVs with __try/__except is MSVC only, not general C++
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]

13 years agoNo need to explicitly check AvARYLEN in 5.10 and later.
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