In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/8e5dcc37de4ab79d8ec6f30798947ae97355ff2a?hp=a5dbacf870d1302d609ce1aa791d9bf35e3d443b>
- Log ----------------------------------------------------------------- commit 8e5dcc37de4ab79d8ec6f30798947ae97355ff2a Author: Aaron Crane <a...@cpan.org> Date: Thu Mar 20 15:54:11 2014 +0000 Upgrade Devel::PPPort from 3.21 to 3.22 [DELTA] * Add support for the following API SvREFCNT_dec_NN mg_findext sv_unmagicext * Update META Move bug tracker to github Provide link to repository M Porting/Maintainers.pl M cpan/Devel-PPPort/Makefile.PL M cpan/Devel-PPPort/PPPort_pm.PL M cpan/Devel-PPPort/parts/apicheck.pl M cpan/Devel-PPPort/parts/inc/SvREFCNT M cpan/Devel-PPPort/parts/inc/call M cpan/Devel-PPPort/parts/inc/magic M cpan/Devel-PPPort/parts/inc/pv_tools M cpan/Devel-PPPort/soak M cpan/Devel-PPPort/t/SvREFCNT.t M cpan/Devel-PPPort/t/magic.t commit 6fa4f5e39a4e2b5d7a131bd1ed0247c1c70c25dc Author: Aaron Crane <a...@cpan.org> Date: Thu Mar 20 13:32:16 2014 +0000 Update perldelta for recent core changes M pod/perldelta.pod commit 2d9bb212d801a022baa8a10f6254372cd3da68b3 Author: Aaron Crane <a...@cpan.org> Date: Thu Mar 20 15:31:34 2014 +0000 ExtUtils-Install-1.63 has been released to CPAN M Porting/Maintainers.pl ----------------------------------------------------------------------- Summary of changes: Porting/Maintainers.pl | 4 +- cpan/Devel-PPPort/Makefile.PL | 15 +++ cpan/Devel-PPPort/PPPort_pm.PL | 6 +- cpan/Devel-PPPort/parts/apicheck.pl | 1 + cpan/Devel-PPPort/parts/inc/SvREFCNT | 21 ++- cpan/Devel-PPPort/parts/inc/call | 3 + cpan/Devel-PPPort/parts/inc/magic | 243 ++++++++++++++++++++++++++++++++++- cpan/Devel-PPPort/parts/inc/pv_tools | 4 +- cpan/Devel-PPPort/soak | 2 +- cpan/Devel-PPPort/t/SvREFCNT.t | 4 +- cpan/Devel-PPPort/t/magic.t | 28 +++- pod/perldelta.pod | 82 +++++++++++- 12 files changed, 397 insertions(+), 16 deletions(-) diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index 1366783..ce13163 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -351,7 +351,7 @@ use File::Glob qw(:case); }, 'Devel::PPPort' => { - 'DISTRIBUTION' => 'MHX/Devel-PPPort-3.21.tar.gz', + 'DISTRIBUTION' => 'WOLFSAGE/Devel-PPPort-3.22.tar.gz', # RJBS has asked MHX to have UPSTREAM be 'blead' # (i.e. move this from cpan/ to dist/) 'FILES' => q[cpan/Devel-PPPort], @@ -459,7 +459,7 @@ use File::Glob qw(:case); }, 'ExtUtils::Install' => { - 'DISTRIBUTION' => 'BINGOS/ExtUtils-Install-1.62.tar.gz', + 'DISTRIBUTION' => 'BINGOS/ExtUtils-Install-1.63.tar.gz', 'FILES' => q[dist/ExtUtils-Install], 'EXCLUDED' => [ qw( t/lib/Test/Builder.pm diff --git a/cpan/Devel-PPPort/Makefile.PL b/cpan/Devel-PPPort/Makefile.PL index 2353324..25e352e 100644 --- a/cpan/Devel-PPPort/Makefile.PL +++ b/cpan/Devel-PPPort/Makefile.PL @@ -34,6 +34,21 @@ WriteMakefile( OBJECT => 'RealPPPort$(OBJ_EXT) $(O_FILES)', XSPROTOARG => '-noprototypes', CONFIGURE => \&configure, + META_MERGE => { + 'meta-spec' => { + version => 2, + }, + resources => { + bugtracker => { + web => 'https://github.com/mhx/Devel-PPPort/issues/', + }, + repository => { + type => 'git', + url => 'git://github.com/mhx/Devel-PPPort.git', + web => 'https://github.com/mhx/Devel-PPPort/', + }, + }, + }, ); sub configure diff --git a/cpan/Devel-PPPort/PPPort_pm.PL b/cpan/Devel-PPPort/PPPort_pm.PL index 23ffb6b..4a30252 100644 --- a/cpan/Devel-PPPort/PPPort_pm.PL +++ b/cpan/Devel-PPPort/PPPort_pm.PL @@ -499,6 +499,10 @@ Version 2.x was ported to the Perl core by Paul Marquess. Version 3.x was ported back to CPAN by Marcus Holland-Moritz. +=item * + +Versions >= 3.22 are maintained with support from Matthew Horsfall (alh). + =back =head1 COPYRIGHT @@ -523,7 +527,7 @@ package Devel::PPPort; use strict; use vars qw($VERSION $data); -$VERSION = '3.21'; +$VERSION = '3.22'; sub _init_data { diff --git a/cpan/Devel-PPPort/parts/apicheck.pl b/cpan/Devel-PPPort/parts/apicheck.pl index e11187f..bea9bac 100644 --- a/cpan/Devel-PPPort/parts/apicheck.pl +++ b/cpan/Devel-PPPort/parts/apicheck.pl @@ -146,6 +146,7 @@ print OUT <<HEAD; #define NEED_load_module #define NEED_my_snprintf #define NEED_my_sprintf +#define NEED_mg_findext #define NEED_my_strlcat #define NEED_my_strlcpy #define NEED_newCONSTSUB diff --git a/cpan/Devel-PPPort/parts/inc/SvREFCNT b/cpan/Devel-PPPort/parts/inc/SvREFCNT index 422aa58..3c113e8 100644 --- a/cpan/Devel-PPPort/parts/inc/SvREFCNT +++ b/cpan/Devel-PPPort/parts/inc/SvREFCNT @@ -15,6 +15,7 @@ SvREFCNT_inc SvREFCNT_inc_simple SvREFCNT_inc_NN SvREFCNT_inc_void +SvREFCNT_dec_NN __UNDEFINED__ =implementation @@ -76,6 +77,20 @@ __UNDEFINED__ # endif #endif +#ifndef SvREFCNT_dec_NN +# ifdef PERL_USE_GCC_BRACE_GROUPS +# define SvREFCNT_dec_NN(sv) \ + ({ \ + SV * const _sv = (SV*)(sv); \ + SvREFCNT(_sv)--; \ + _sv; \ + }) +# else +# define SvREFCNT_dec_NN(sv) \ + (PL_Sv=(SV*)(sv),--(SvREFCNT(PL_Sv)),PL_Sv) +# endif +#endif + __UNDEFINED__ SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END __UNDEFINED__ SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv)) __UNDEFINED__ SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv))) @@ -110,13 +125,15 @@ SvREFCNT() mXPUSHi(SvREFCNT(sv) == 8); SvREFCNT_inc_simple_void_NN(sv); mXPUSHi(SvREFCNT(sv) == 9); + SvREFCNT_dec_NN(sv); + mXPUSHi(SvREFCNT(sv) == 8); while (SvREFCNT(sv) > 1) SvREFCNT_dec(sv); mXPUSHi(SvREFCNT(sv) == 1); SvREFCNT_dec(sv); - XSRETURN(14); + XSRETURN(15); -=tests plan => 14 +=tests plan => 15 for (Devel::PPPort::SvREFCNT()) { ok(defined $_ and $_); diff --git a/cpan/Devel-PPPort/parts/inc/call b/cpan/Devel-PPPort/parts/inc/call index 6ccd9e7..7d8e4d3 100644 --- a/cpan/Devel-PPPort/parts/inc/call +++ b/cpan/Devel-PPPort/parts/inc/call @@ -124,6 +124,9 @@ vload_module(U32 flags, SV *name, SV *ver, va_list *args) #if { VERSION >= 5.004 } utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0), veop, modname, imop); +#elif { VERSION > 5.003 } + utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(), + veop, modname, imop); #else utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(), modname, imop); diff --git a/cpan/Devel-PPPort/parts/inc/magic b/cpan/Devel-PPPort/parts/inc/magic index 59cd40b..6fe1ac8 100644 --- a/cpan/Devel-PPPort/parts/inc/magic +++ b/cpan/Devel-PPPort/parts/inc/magic @@ -11,14 +11,34 @@ =provides +mg_findext +sv_unmagicext + __UNDEFINED__ /sv_\w+_mg/ sv_magic_portable +MUTABLE_PTR +MUTABLE_SV =implementation __UNDEFINED__ SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END +/* Some random bits for sv_unmagicext. These should probably be pulled in for + real and organized at some point */ + +__UNDEFINED__ HEf_SVKEY -2 + +#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) +# define MUTABLE_PTR(p) ({ void *_p = (p); _p; }) +#else +# define MUTABLE_PTR(p) ((void *) (p)) +#endif + +#define MUTABLE_SV(p) ((SV *)MUTABLE_PTR(p)) + +/* end of random bits */ + __UNDEFINED__ PERL_MAGIC_sv '\0' __UNDEFINED__ PERL_MAGIC_overload 'A' __UNDEFINED__ PERL_MAGIC_overload_elem 'a' @@ -200,8 +220,205 @@ __UNDEFINED__ SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring #endif +#if !defined(mg_findext) +#if { NEED mg_findext } + +MAGIC * +mg_findext(pTHX_ SV * sv, int type, const MGVTBL *vtbl) { + if (sv) { + MAGIC *mg; + +#ifdef AvPAD_NAMELIST + assert(!(SvTYPE(sv) == SVt_PVAV && AvPAD_NAMELIST(sv))); +#endif + + for (mg = SvMAGIC (sv); mg; mg = mg->mg_moremagic) { + if (mg->mg_type == type && mg->mg_virtual == vtbl) + return mg; + } + } + + return NULL; +} + +#endif +#endif + +#if !defined(sv_unmagicext) +#if { NEED sv_unmagicext } + +int +sv_unmagicext(pTHX_ SV *const sv, const int type, MGVTBL *vtbl) +{ + MAGIC* mg; + MAGIC** mgp; + + if (SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv)) + return 0; + mgp = &(SvMAGIC(sv)); + for (mg = *mgp; mg; mg = *mgp) { + const MGVTBL* const virt = mg->mg_virtual; + if (mg->mg_type == type && virt == vtbl) { + *mgp = mg->mg_moremagic; + if (virt && virt->svt_free) + virt->svt_free(aTHX_ sv, mg); + if (mg->mg_ptr && mg->mg_type != PERL_MAGIC_regex_global) { + if (mg->mg_len > 0) + Safefree(mg->mg_ptr); + else if (mg->mg_len == HEf_SVKEY) /* Questionable on older perls... */ + SvREFCNT_dec(MUTABLE_SV(mg->mg_ptr)); + else if (mg->mg_type == PERL_MAGIC_utf8) + Safefree(mg->mg_ptr); + } + if (mg->mg_flags & MGf_REFCOUNTED) + SvREFCNT_dec(mg->mg_obj); + Safefree(mg); + } + else + mgp = &mg->mg_moremagic; + } + if (SvMAGIC(sv)) { + if (SvMAGICAL(sv)) /* if we're under save_magic, wait for restore_magic; */ + mg_magical(sv); /* else fix the flags now */ + } + else { + SvMAGICAL_off(sv); + SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT; + } + return 0; +} + +#endif +#endif + +=xsinit + +#define NEED_mg_findext +#define NEED_sv_unmagicext + +#ifndef STATIC +#define STATIC static +#endif + +STATIC MGVTBL null_mg_vtbl = { + NULL, /* get */ + NULL, /* set */ + NULL, /* len */ + NULL, /* clear */ + NULL, /* free */ +#if MGf_COPY + NULL, /* copy */ +#endif /* MGf_COPY */ +#if MGf_DUP + NULL, /* dup */ +#endif /* MGf_DUP */ +#if MGf_LOCAL + NULL, /* local */ +#endif /* MGf_LOCAL */ +}; + +STATIC MGVTBL other_mg_vtbl = { + NULL, /* get */ + NULL, /* set */ + NULL, /* len */ + NULL, /* clear */ + NULL, /* free */ +#if MGf_COPY + NULL, /* copy */ +#endif /* MGf_COPY */ +#if MGf_DUP + NULL, /* dup */ +#endif /* MGf_DUP */ +#if MGf_LOCAL + NULL, /* local */ +#endif /* MGf_LOCAL */ +}; + =xsubs +SV * +new_with_other_mg(package, ...) + SV *package + PREINIT: + HV *self; + HV *stash; + SV *self_ref; + int i = 0; + const char *data = "hello\0"; + MAGIC *mg; + CODE: + self = newHV(); + stash = gv_stashpv(SvPV_nolen(package), 0); + + self_ref = newRV_noinc((SV*)self); + + sv_magic((SV*)self, NULL, PERL_MAGIC_ext, data, strlen(data)); + mg = mg_find((SV*)self, PERL_MAGIC_ext); + mg->mg_virtual = &other_mg_vtbl; + + RETVAL = sv_bless(self_ref, stash); + OUTPUT: + RETVAL + +SV * +new_with_mg(package, ...) + SV *package + PREINIT: + HV *self; + HV *stash; + SV *self_ref; + int i = 0; + const char *data = "hello\0"; + MAGIC *mg; + CODE: + self = newHV(); + stash = gv_stashpv(SvPV_nolen(package), 0); + + self_ref = newRV_noinc((SV*)self); + + sv_magic((SV*)self, NULL, PERL_MAGIC_ext, data, strlen(data)); + mg = mg_find((SV*)self, PERL_MAGIC_ext); + mg->mg_virtual = &null_mg_vtbl; + + RETVAL = sv_bless(self_ref, stash); + OUTPUT: + RETVAL + +void +remove_null_magic(self) + SV *self + PREINIT: + HV *obj; + PPCODE: + obj = (HV*) SvRV(self); + + sv_unmagicext((SV*)obj, PERL_MAGIC_ext, &null_mg_vtbl); + +void +remove_other_magic(self) + SV *self + PREINIT: + HV *obj; + PPCODE: + obj = (HV*) SvRV(self); + + sv_unmagicext((SV*)obj, PERL_MAGIC_ext, &other_mg_vtbl); + +void +as_string(self) + SV *self + PREINIT: + HV *obj; + MAGIC *mg; + PPCODE: + obj = (HV*) SvRV(self); + + if (mg = mg_findext((SV*)obj, PERL_MAGIC_ext, &null_mg_vtbl)) { + XPUSHs(sv_2mortal(newSVpv(mg->mg_ptr, strlen(mg->mg_ptr)))); + } else { + XPUSHs(sv_2mortal(newSVpvs("Sorry, your princess is in another castle."))); + } + void sv_catpv_mg(sv, string) SV *sv; @@ -314,7 +531,31 @@ sv_magic_portable(sv) OUTPUT: RETVAL -=tests plan => 15 +=tests plan => 23 + +# Find proper magic +ok(my $obj1 = Devel::PPPort->new_with_mg()); +ok(Devel::PPPort::as_string($obj1), 'hello'); + +# Find with no magic +my $obj = bless {}, 'Fake::Class'; +ok(Devel::PPPort::as_string($obj), "Sorry, your princess is in another castle."); + +# Find with other magic (not the magic we are looking for) +ok($obj = Devel::PPPort->new_with_other_mg()); +ok(Devel::PPPort::as_string($obj), "Sorry, your princess is in another castle."); + +# Okay, attempt to remove magic that isn't there +Devel::PPPort::remove_other_magic($obj1); +ok(Devel::PPPort::as_string($obj1), 'hello'); + +# Remove magic that IS there +Devel::PPPort::remove_null_magic($obj1); +ok(Devel::PPPort::as_string($obj1), "Sorry, your princess is in another castle."); + +# Removing when no magic present +Devel::PPPort::remove_null_magic($obj1); +ok(Devel::PPPort::as_string($obj1), "Sorry, your princess is in another castle."); use Tie::Hash; my %h; diff --git a/cpan/Devel-PPPort/parts/inc/pv_tools b/cpan/Devel-PPPort/parts/inc/pv_tools index a8a477f..41a4907 100644 --- a/cpan/Devel-PPPort/parts/inc/pv_tools +++ b/cpan/Devel-PPPort/parts/inc/pv_tools @@ -80,10 +80,10 @@ pv_escape(pTHX_ SV *dsv, char const * const str, if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) { if (flags & PERL_PV_ESCAPE_FIRSTCHAR) chsize = my_snprintf(octbuf, sizeof octbuf, - "%"UVxf, u); + "%" UVxf, u); else chsize = my_snprintf(octbuf, sizeof octbuf, - "%cx{%"UVxf"}", esc, u); + "%cx{%" UVxf "}", esc, u); } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) { chsize = 1; } else { diff --git a/cpan/Devel-PPPort/soak b/cpan/Devel-PPPort/soak index da0dfae..522d6ea 100644 --- a/cpan/Devel-PPPort/soak +++ b/cpan/Devel-PPPort/soak @@ -27,7 +27,7 @@ use File::Find; use List::Util qw(max); use Config; -my $VERSION = '3.21'; +my $VERSION = '3.22'; $| = 1; my %OPT = ( diff --git a/cpan/Devel-PPPort/t/SvREFCNT.t b/cpan/Devel-PPPort/t/SvREFCNT.t index 0b46a51..7f228b0 100644 --- a/cpan/Devel-PPPort/t/SvREFCNT.t +++ b/cpan/Devel-PPPort/t/SvREFCNT.t @@ -30,9 +30,9 @@ BEGIN { require 'testutil.pl' if $@; } - if (14) { + if (15) { load(); - plan(tests => 14); + plan(tests => 15); } } diff --git a/cpan/Devel-PPPort/t/magic.t b/cpan/Devel-PPPort/t/magic.t index 0bfe053..f467613 100644 --- a/cpan/Devel-PPPort/t/magic.t +++ b/cpan/Devel-PPPort/t/magic.t @@ -30,9 +30,9 @@ BEGIN { require 'testutil.pl' if $@; } - if (15) { + if (23) { load(); - plan(tests => 15); + plan(tests => 23); } } @@ -48,6 +48,30 @@ bootstrap Devel::PPPort; package main; +# Find proper magic +ok(my $obj1 = Devel::PPPort->new_with_mg()); +ok(Devel::PPPort::as_string($obj1), 'hello'); + +# Find with no magic +my $obj = bless {}, 'Fake::Class'; +ok(Devel::PPPort::as_string($obj), "Sorry, your princess is in another castle."); + +# Find with other magic (not the magic we are looking for) +ok($obj = Devel::PPPort->new_with_other_mg()); +ok(Devel::PPPort::as_string($obj), "Sorry, your princess is in another castle."); + +# Okay, attempt to remove magic that isn't there +Devel::PPPort::remove_other_magic($obj1); +ok(Devel::PPPort::as_string($obj1), 'hello'); + +# Remove magic that IS there +Devel::PPPort::remove_null_magic($obj1); +ok(Devel::PPPort::as_string($obj1), "Sorry, your princess is in another castle."); + +# Removing when no magic present +Devel::PPPort::remove_null_magic($obj1); +ok(Devel::PPPort::as_string($obj1), "Sorry, your princess is in another castle."); + use Tie::Hash; my %h; tie %h, 'Tie::StdHash'; diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 548cb32..aba96ba 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -111,6 +111,11 @@ or C<E<lt>E<gt>> operator, the data is no longer copied unnecessarily. =item * +Executing a regex that contains the C<^> anchor (or its variant under the +C</m> flag) has been made much faster in several situations. + +=item * + It is now faster to create certain sorts of lists, including array and hash slices. @@ -129,6 +134,29 @@ doesn't overload any of the dereferencing methods C<@{}>, C<%{}>, and so on. =item * +The first iteration over a large hash (using C<keys> or C<each>) is now +faster. This is achieved by preallocating the hash's internal iterator +state, rather than lazily creating it when the hash is first iterated. (For +small hashes, the iterator is still created only when first needed. The +assumption is that small hashes are more likely to be used as objects, and +therefore never allocated. For large hashes, that's less likely to be true, +and the cost of allocating the iterator is swamped by the cost of allocating +space for the hash itself.) + +=item * + +Perl's optimiser no longer skips optimising code that follows certain +C<eval {}> expressions (including those with an apparent infinite loop). + +=item * + +The implementation now does a better job of avoiding meaningless work at +runtime. Internal effect-free "null" operations (created as a side-effect of +parsing Perl programs) are normally deleted during compilation. That +deletion is now applied in some situations that weren't previously handled. + +=item * + A few micro-optimisations have been applied to performance-sensitive parts of the implementation, including subroutine invocation and scope exit. @@ -234,13 +262,17 @@ XXX Changes which significantly change existing files in F<pod/> go here. However, any changes to F<pod/perldiag.pod> should go in the L</Diagnostics> section. -=head3 L<XXX> +=head3 L<perllexwarn> and L<warnings> =over 4 =item * -XXX Description of the change here +The L<perllexwarn> documentation used to describe the hierarchy of warning +categories understood by the L<warnings> pragma. That description has now +been moved to the L<warnings> documentation itself, leaving L<perllexwarn> +as a stub that points to it. This change consolidates all documentation for +lexical warnings in a single place. =back @@ -329,6 +361,11 @@ build. Currently around 80 extensions can be processed directly by the F<make_ext.pl> tool, meaning that 80 invocations of F<make> and 160 invocations of F<miniperl> are no longer made. +=item * + +The build system now works correctly when compiling under GCC or Clang with +link-time optimization enabled (the C<-flto> option). [perl #113022] + =back =head1 Testing @@ -345,7 +382,17 @@ that they represent may be covered elsewhere. =item * -XXX +The test suite no longer fails when the user's interactive shell maintains a +C<$PWD> environment variable, but the F</bin/sh> used for running tests +doesn't. + +=item * + +The C<test.valgrind> make target now allows tests to be run in parallel. +This target allows Perl's test suite to be run under Valgrind, which detects +certain sorts of C programming errors, though at significant cost in running +time. On suitable hardware, allowing parallel execution claws back a lot of +that additional cost. [perl #121431] =back @@ -390,6 +437,29 @@ and compilation changes or changes in portability/compatibility. However, changes within modules for platforms should generally be listed in the L</Modules and Pragmata> section. +=head3 Linux + +=over 4 + +=item * + +The hints file now looks for C<libgdbm_compat> only if C<libgdbm> itself is +also wanted. The former is never useful without the latter, and in some +circumstances, including it could actually prevent building. + +=back + +=head3 Mac OS + +=over 4 + +=item * + +The build system now honours an C<ld> setting supplied by the user running +F<Configure>. + +=back + =head3 Win32 =over 4 @@ -442,6 +512,12 @@ files in F<ext/> and F<lib/> are best summarized in L</Modules and Pragmata>. Static builds, as configured with C<-Uusedl> now build correctly. [perl #121291] +=item * + +Regexes with backreferences nested inside subpattern references now behave +more consistently: match variables are dynamically scoped during the +execution of the subpattern call. [perl #121299] + =back =head1 Known Problems -- Perl5 Master Repository