develooper Front page | perl.perl5.porters | Postings from June 2014

[perl #122031] Bleadperl v5.21.0-129-g8dab3ba breaks MLEHMANN/Guard-1.022.tar.gz

Thread Next
From:
Reini Urban via RT
Date:
June 27, 2014 15:25
Subject:
[perl #122031] Bleadperl v5.21.0-129-g8dab3ba breaks MLEHMANN/Guard-1.022.tar.gz
Message ID:
rt-4.0.18-11582-1403882730-546.122031-15-0@perl.org
On Wed Jun 04 00:40:25 2014, smueller@cpan.org wrote:
> On 06/04/2014 03:05 AM, (Andreas J. Koenig) (via RT) wrote:
> > # New Ticket Created by  (Andreas J. Koenig)
> > # Please include the string:  [perl #122031]
> > # in the subject line of all future correspondence about this issue.
> > # <URL: https://rt.perl.org/Ticket/Display.html?id=122031 >
> >
> >
> > git bisect
> > ----------
> > commit 8dab3ba5fe05d49fe039bc05012fdab8bc572a5c
> > Author: Karl Williamson <public@khwilliamson.com>
> > Date:   Tue Apr 8 18:46:25 2014 -0600
> >
> > Remove deprecated 'PL_sv_objcount'
> >
> > diagnostics
> > -----------
> > Guard.xs: In function ‘XS_Guard_guard’:
> > Guard.xs:113:11: error: ‘PL_sv_objcount’ undeclared (first use in
> > this function)
> >           ++PL_sv_objcount;
> >             ^
> > Guard.xs:113:11: note: each undeclared identifier is reported only
> > once for each function it appears in
> 
> The fix for this one is literally just to remove that line of code.
> IIRC
> reason for deprecation is that PL_sv_objcount was not being used in
> core
> at all and that it was being kept updated (somewhat) as useless busy
> work.

Let's explain it like this:
The fix is to check the version.

--- ./Guard.xs~	2009-07-18 23:58:41.000000000 -0500
+++ ./Guard.xs	2014-06-27 10:18:45.821008691 -0500
@@ -110,7 +110,9 @@
         sv_magicext (guard, cv, PERL_MAGIC_ext, &guard_vtbl, 0, 0);
         RETVAL = newRV_noinc (guard);
         SvOBJECT_on (guard);
+#if PERL_VERSION < 18
         ++PL_sv_objcount;
+#endif
         SvSTASH_set (guard, (HV*)SvREFCNT_inc ((SV *)guard_stash));
 }
 	OUTPUT:


bless does not inc PL_sv_objcount since 5.17.11 anymore and does global destruction without checking for PL_sv_objcount, which slows down global destruction in the case of small scripts without any blessed objects.

5.21 removed now the variable at all, so that's why you get this error only now. 
But it was effectively unused since 5.18.

-- 
Reini Urban

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=122031

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About