This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
6 years agoRemove 'our' from one non-Exporter-related variable.
James E Keenan [Thu, 29 Mar 2018 22:31:14 +0000 (18:31 -0400)]
Remove 'our' from one non-Exporter-related variable.

6 years agoUse lexically scoped ('our') variables in POD examples.
James E Keenan [Thu, 29 Mar 2018 13:36:57 +0000 (09:36 -0400)]
Use lexically scoped ('our') variables in POD examples.

Per Dan Book recommendation, as this is code likely to be copied-and-pasted by
people new to Perl.

Keep podcheck happy.

For: RT # 133040

6 years agoUpdate proto.h
Karl Williamson [Thu, 29 Mar 2018 16:08:43 +0000 (10:08 -0600)]
Update proto.h

It turns out I didn't do a format-patch after fixing this unregenerated
proto.h bug in 0dc258e2b8d107ef76f2d62c1a1a68222fd1e769, so I ended up
pushing an outdated version.

6 years agoembed.fnc: Add a const to parameter
Karl Williamson [Thu, 29 Mar 2018 16:08:43 +0000 (10:08 -0600)]
embed.fnc: Add a const to parameter

To match what the file declares it as.

6 years agoMaintain extralibs order for linker
Sergey Aleynikov [Wed, 28 Mar 2018 20:53:32 +0000 (23:53 +0300)]
Maintain extralibs order for linker

As per discussion in RT # 132992

6 years agoFix ALL_STATIC builds with MinGW
Sergey Aleynikov [Wed, 28 Mar 2018 20:28:56 +0000 (23:28 +0300)]
Fix ALL_STATIC builds with MinGW

ALL_STATIC required BUILD_STATIC set but that was not documented.

6 years agoFix spelling in windows makefiles
Sergey Aleynikov [Wed, 28 Mar 2018 20:26:20 +0000 (23:26 +0300)]
Fix spelling in windows makefiles

6 years agoFix static builds with MinGW
Sergey Aleynikov [Wed, 28 Mar 2018 19:35:05 +0000 (22:35 +0300)]
Fix static builds with MinGW

Move Extensions_normalize target before Extensions
target to satisfy dependencies.

6 years agoUpdate links in Devel::PPPort documentation
Sergey Aleynikov [Mon, 26 Mar 2018 20:39:45 +0000 (23:39 +0300)]
Update links in Devel::PPPort documentation

So they no longer point to github, as it's now maintained in-core.

(The committer fixed the links to be mailto:s and bumped the version
number

6 years agoUpdate RT path for Devel::PPPort
Sergey Aleynikov [Mon, 26 Mar 2018 20:26:47 +0000 (23:26 +0300)]
Update RT path for Devel::PPPort

6 years agoutf8.c: fix leak
Karl Williamson [Tue, 27 Mar 2018 15:57:44 +0000 (09:57 -0600)]
utf8.c: fix leak

Commit 8946fcd98c63bdc848cec00a1c72aaf232d932a1 failed to free a scalar
it created.  I meant to do so, but in the end, forgot.

6 years agoRegen uconfig.h
Karl Williamson [Tue, 27 Mar 2018 18:17:50 +0000 (12:17 -0600)]
Regen uconfig.h

After 0cc3cc274e71bf1211f53331f706d17b75acdd54

6 years agoMark unused dl_unload_all_files() argument
Dagfinn Ilmari Mannsåker [Tue, 27 Mar 2018 12:22:57 +0000 (13:22 +0100)]
Mark unused dl_unload_all_files() argument

6 years agoWhitespace consistency
H.Merijn Brand [Tue, 27 Mar 2018 09:13:53 +0000 (11:13 +0200)]
Whitespace consistency

6 years agoFix building with -Accflags=-DDL_UNLOAD_ALL_AT_EXIT
Dagfinn Ilmari Mannsåker [Tue, 27 Mar 2018 08:10:11 +0000 (09:10 +0100)]
Fix building with -Accflags=-DDL_UNLOAD_ALL_AT_EXIT

Commit bb6a367ad5d replaced an XPUSHs inside a loop with an EXTEND
outside it, but didn't move the dSP to match.  Even if it did, that
would have been wrong, since the loop might push more than one value.
Revert that bit of the commit.

In passing, move the declaration of dl_librefs and dl_libref into the
scope where they're used.

6 years agod_strchr is C89 and has been removed from Configure
H.Merijn Brand [Tue, 27 Mar 2018 07:17:48 +0000 (09:17 +0200)]
d_strchr is C89 and has been removed from Configure

6 years agoMove some inversion list init to perl.c
Karl Williamson [Sun, 25 Mar 2018 17:58:55 +0000 (11:58 -0600)]
Move some inversion list init to perl.c

The initialization time spent here is trivial, and this saves a copy of
these arrays on some systems.  This is because there is only one perl.c,
and there is both regcomp.c and re_comp.c which would contain the
identical static const array.  Some OS's won't remove the duplicate
copies.

6 years agoMove case change invlists from interpreter to global
Karl Williamson [Sun, 25 Mar 2018 17:41:15 +0000 (11:41 -0600)]
Move case change invlists from interpreter to global

These are now constant through the life of the program, so don't need to
be duplicated at each new thread instantiation.

6 years agoregen/mk_invlists.pl: Fix comment gobbleldy gook
Karl Williamson [Sun, 25 Mar 2018 04:21:45 +0000 (22:21 -0600)]
regen/mk_invlists.pl: Fix comment gobbleldy gook

6 years agoMove UTF-8 case changing data into core
Karl Williamson [Fri, 23 Mar 2018 19:43:56 +0000 (13:43 -0600)]
Move UTF-8 case changing data into core

Prior to this commit, if a program wanted to compute the case-change of
a character above 0xFF, the C code would switch to perl, loading
lib/utf8heavy.pl and then read another file from disk, and then create a
hash.  Future references would use the hash, but the start up cost is
quite large.  There are five case change types, uc, lc, tc, fc, and
simple fc.  Only the first encountered requires loading of utf8_heavy,
but each required switching to utf8_heavy, and reading the appropriate
file from disk.

This commit changes these functions to use compiled-in C data structures
(inversion maps) to represent the data.  To look something up requires a
binary search instead of a hash lookup.

An individual hash lookup tends to be faster than a binary search,  but
the differences are small for small sizes.  I did some benchmarking some
years ago, (commit message 87367d5f9dc9bbf7db1a6cf87820cea76571bf1a) and
the results were that for fewer than 512 entries, the binary search was
just as fast as a hash, if not actually faster.  Now, I've done some
more benchmarks on blead, using the tool benchmark.pl, which wasn't
available back then.  The results below indicate that the differences
are minimal up through 2047 entries, which all Unicode properties are
well within.

A hash, PL_foldclosures, is still constructed at runtime for the case of
regular expression /i matching, and this could be generated at Perl
compile time, as a further enhancement for later.  But reading a file
from disk is no longer required to do this.

======================= benchmarking results =======================

Key:
    Ir   Instruction read
    Dr   Data read
    Dw   Data write
    COND conditional branches
    IND  indirect branches
    _m   branch predict miss
    _m1  level 1 cache miss
    _mm  last cache (e.g. L3) miss
    -    indeterminate percentage (e.g. 1/0)

The numbers represent raw counts per loop iteration.

"\x{10000}" =~ qr/\p{CWKCF}/"

        swash invlist Ratio %
        fetch search
       ------ ------- -------
    Ir 2259.0  2264.0    99.8
    Dr  665.0   664.0   100.2
    Dw  406.0   404.0   100.5
  COND  406.0   405.0   100.2
   IND   17.0    15.0   113.3

COND_m    8.0     8.0   100.0
 IND_m    4.0     4.0   100.0

 Ir_m1    8.9    17.0    52.4
 Dr_m1    4.5     3.4   132.4
 Dw_m1    1.9     1.2   158.3

 Ir_mm    0.0     0.0   100.0
 Dr_mm    0.0     0.0   100.0
 Dw_mm    0.0     0.0   100.0

These were constructed by using the file whose contents are below, which
uses the property in Unicode that currently has the largest number of
entries in its inversion list, > 1600.  The test was run on blead -O2,
no debugging, no threads.  Then the cut-off boundary was changed from
512 to 2047 for when we use a hash vs an inversion list, and the test
run again.  This yields the difference between a hash fetch and an
inversion list binary search
===================== The benchmark file is below ===============

no warnings 'once';

my @benchmarks;

    push @benchmarks, 'swash' => {
        desc    => '"\x{10000}" =~ qr/\p{CWKCF}/"',
        setup   => 'no warnings "once"; my $re = qr/\p{CWKCF}/; my $a =
"\x{10000}";',
        code     => '$a =~ $re;',
    };

\@benchmarks;

6 years agoregen/mk_invlists.pl: Add case changing tables
Karl Williamson [Fri, 23 Mar 2018 19:27:25 +0000 (13:27 -0600)]
regen/mk_invlists.pl: Add case changing tables

This will be used by a future commit.

6 years agoregen/mk_invlists.pl: White space only
Karl Williamson [Fri, 23 Mar 2018 18:26:12 +0000 (12:26 -0600)]
regen/mk_invlists.pl: White space only

This properly indents some code blocks.

6 years agoregen/mk_invlists.pl: Allow to Generate code point mappings
Karl Williamson [Fri, 23 Mar 2018 18:22:06 +0000 (12:22 -0600)]
regen/mk_invlists.pl: Allow to Generate code point mappings

This expands the code to handle code point mapping inversion maps.  This
capability will be used in a future commit to handle case changing
operations in utf8.c.

6 years agoregen/mk_invlists.pl: Fix bug with adjusted inputs
Karl Williamson [Sun, 25 Mar 2018 00:52:44 +0000 (18:52 -0600)]
regen/mk_invlists.pl: Fix bug with adjusted inputs

This doesn't affect any current uses, but we need to better account for
adjusted inversion maps.

6 years agoregen/mk_invlists.pl: Suppress empty enum declarations
Karl Williamson [Fri, 23 Mar 2018 18:11:48 +0000 (12:11 -0600)]
regen/mk_invlists.pl: Suppress empty enum declarations

This diverts the outputting of the enum typedefs until after they are
fully known, so that an empty one can be suppressed.

A future commit will need this

6 years agoregen/mk_invlists.pl: Allow enum defns to be public
Karl Williamson [Fri, 23 Mar 2018 17:55:28 +0000 (11:55 -0600)]
regen/mk_invlists.pl: Allow enum defns to be public

This adds the ability for an enum typedef to be able to be made public.
Earlier in 5.27, commit c0221e16334efbe9723722578949dc3916d669d4 was
made to revert fea79782ed31ac4faa71eb6193faff54b4bbe249, because it
created bloat due to multiple statics of large arrays

This current commit is an alternative approach to
fea79782ed31ac4faa71eb6193faff54b4bbe249, but which doesn't create
bloat.  But the capability is commented out because it isn't needed in
5.28

6 years agoregen/mk_invlists.pl: Handle EBCDIC
Karl Williamson [Thu, 22 Mar 2018 20:25:44 +0000 (14:25 -0600)]
regen/mk_invlists.pl: Handle EBCDIC

The code and comment here were out-of-date.  When we are constructing
EBCDIC we need to modify the code points that are the result of a case
change that expands to more than one code point.  This code is not
currently in used.

6 years agoregen/mk_invlists.pl: Remove Currency_Symbol definition
Karl Williamson [Fri, 23 Mar 2018 15:52:57 +0000 (09:52 -0600)]
regen/mk_invlists.pl: Remove Currency_Symbol definition

This is unused in 5.28.

6 years agoAdd epigraphs for 5.24.4-RC1 and 5.26.2-RC1
Steve Hay [Sat, 24 Mar 2018 19:54:23 +0000 (19:54 +0000)]
Add epigraphs for 5.24.4-RC1 and 5.26.2-RC1

6 years ago5.24.4-RC1 and 5.26.2-RC1 today
Steve Hay [Sat, 24 Mar 2018 17:23:37 +0000 (17:23 +0000)]
5.24.4-RC1 and 5.26.2-RC1 today

6 years agoBump Time-HiRes to 1.9759 to revert changes from 1.9754..1.9758 on CPAN
Todd Rinaldo [Fri, 23 Mar 2018 16:48:39 +0000 (11:48 -0500)]
Bump Time-HiRes to 1.9759 to revert changes from 1.9754..1.9758 on CPAN

Tag Porting/Maintainers.pl so it is clear that a release to CPAN is
outstanding.

6 years agoRevert "Upgrade Time::HiRes from version 1.9753 to 1.9757"
Todd Rinaldo [Fri, 23 Mar 2018 16:36:08 +0000 (11:36 -0500)]
Revert "Upgrade Time::HiRes from version 1.9753 to 1.9757"

This reverts commit 13813507385079199d99d90776780dcd653f6919.

On recommendation of the Author, we are reverting these changes for
now in order to stabilize blead.

6 years agoRevert "Upgrade Time::HiRes from version 1.9757 to 1.9758"
Todd Rinaldo [Fri, 23 Mar 2018 16:35:45 +0000 (11:35 -0500)]
Revert "Upgrade Time::HiRes from version 1.9757 to 1.9758"

This reverts commit 554c20fe6eab1dc262c2fb2d036b76fa09153f1c.

6 years agoMaint releases are now expected mid-April; RC1s will be out soon
Steve Hay [Thu, 22 Mar 2018 21:33:12 +0000 (21:33 +0000)]
Maint releases are now expected mid-April; RC1s will be out soon

6 years agoRemove redundant advice in the RMG about using pod2html which you were just shown...
Todd Rinaldo [Thu, 22 Mar 2018 20:31:20 +0000 (15:31 -0500)]
Remove redundant advice in the RMG about using pod2html which you were just shown how to use

6 years agoUpdate Porting/Maintainers.pl to match CPAN for Module::CoreList
Todd Rinaldo [Thu, 22 Mar 2018 19:31:54 +0000 (14:31 -0500)]
Update Porting/Maintainers.pl to match CPAN for Module::CoreList

6 years agoUpgrade Time::HiRes from version 1.9757 to 1.9758
Todd Rinaldo [Thu, 22 Mar 2018 19:22:25 +0000 (14:22 -0500)]
Upgrade Time::HiRes from version 1.9757 to 1.9758

[DELTA]

1.9758 [2018-03-21]
 - fix build in Win32 with Visual C by introducing a fake struct timezone
   [rt.cpan.org #124844]
 - in utime.t detect better being run in a noatime filesystem,
   and if so, skip the test (for the HAMMER filesystem of DragonflyBSD)
 - also for the HAMMER fs (if not in noatime), lower the expected subsecond
   timestamp granularity to microseconds
 - fix the version number typo in Changes: 1.9577 -> 1.9757

6 years agoutf8.c: Update comment
Karl Williamson [Thu, 22 Mar 2018 14:27:11 +0000 (08:27 -0600)]
utf8.c: Update comment

6 years agoI18N::Langinfo/t/Langinfo.t: Skip tests on early netbsd
Karl Williamson [Mon, 19 Mar 2018 00:19:48 +0000 (18:19 -0600)]
I18N::Langinfo/t/Langinfo.t: Skip tests on early netbsd

The names of the months and weekdays are swapped with the abbreviated
names before netbsd 7, so skip the tests on those platforms.  See their
commit:

revision 1.12.2.1
 date: 2013-09-07 20:11:41 +0400;  author: bouyer;  state: Exp;  lines:
 +38 -38;  commitid: HURUJwL5bnZmww4x;
  Apply patch, requested by joerg in ticket #934:
    lib/libc/locale/global_locale.c: patch
     provide consistent and correct data for the C locale.

6 years agolocale.c: Really silence compiler warning
Karl Williamson [Thu, 15 Mar 2018 17:37:16 +0000 (11:37 -0600)]
locale.c: Really silence compiler warning

Commit 32a62865ef662fce2b2250a7e0eca15861e7fe20 did not work, as gcc
doesn't recognize a void cast as handling a return value.  This should
hopefully work, though we discard the value before looking at it, which
could cause another warning.

6 years agoop_dump(): display PARENT of top-most node
David Mitchell [Tue, 20 Mar 2018 16:21:20 +0000 (16:21 +0000)]
op_dump(): display PARENT of top-most node

When dumping a subtree, display the op_parent() value for
the top-most node of the subtree.

6 years agoPush release of 5.28 by a month to May
Sawyer X [Wed, 21 Mar 2018 09:05:54 +0000 (11:05 +0200)]
Push release of 5.28 by a month to May

6 years agomktables: Add aliases to the Present_In property
Karl Williamson [Wed, 21 Mar 2018 04:42:31 +0000 (22:42 -0600)]
mktables: Add aliases to the Present_In property

This property parallels the Age property (but is cumulative).  Each
table in it should have the same property value possibilities as the
corresponding Age table.

6 years agoAdjust code which did not get automatically switched over to 5.027011
Todd Rinaldo [Wed, 21 Mar 2018 00:47:24 +0000 (19:47 -0500)]
Adjust code which did not get automatically switched over to 5.027011

The following changes were still required after doing

  $ ./perl -Ilib Porting/bump-perl-version -i 5.27.10 5.27.11

Module::CoreList had to be updated by hand.
Op_private.pm had to be updated by doing regen/opcode.pl lib/B/Op_private.pm

6 years agoDevel::PPPort: Use prefix D_PPP_ for helper macros
Pali [Thu, 15 Mar 2018 19:51:30 +0000 (20:51 +0100)]
Devel::PPPort: Use prefix D_PPP_ for helper macros

Prefix D_PPP_ is already handled by ppptools.pl. This change cleanups code,
makes code more consistent and avoids specifying helper macros in =dontwarn
section.

6 years agoBump the perl version in various places for 5.27.11
Todd Rinaldo [Tue, 20 Mar 2018 21:48:46 +0000 (16:48 -0500)]
Bump the perl version in various places for 5.27.11

6 years agoNew Perldelta for 5.27.11
Todd Rinaldo [Tue, 20 Mar 2018 21:47:13 +0000 (16:47 -0500)]
New Perldelta for 5.27.11

6 years agoTick another dev release off
Chris 'BinGOs' Williams [Tue, 20 Mar 2018 21:30:35 +0000 (21:30 +0000)]
Tick another dev release off

6 years agoEpigraph for 5.27.10
Todd Rinaldo [Tue, 20 Mar 2018 21:29:53 +0000 (16:29 -0500)]
Epigraph for 5.27.10

6 years agoPerlhist entry for 5.27.10 v5.27.10
Todd Rinaldo [Tue, 20 Mar 2018 17:31:44 +0000 (12:31 -0500)]
Perlhist entry for 5.27.10

6 years agoFinalize perldelta for 5.27.10
Todd Rinaldo [Tue, 20 Mar 2018 17:17:27 +0000 (12:17 -0500)]
Finalize perldelta for 5.27.10

6 years agoupdate Module::CoreList for v5.27.10
Todd Rinaldo [Tue, 20 Mar 2018 17:11:12 +0000 (12:11 -0500)]
update Module::CoreList for v5.27.10

6 years agoDeparse.pm: handle postfix $r->$#*
David Mitchell [Tue, 20 Mar 2018 12:05:13 +0000 (12:05 +0000)]
Deparse.pm: handle postfix $r->$#*

(\my @a)->$#*

was being deparsed as

$#{\my @a}

which incorrectly reduced the scope of the lexical @a.

Make Deparse.pm recognise this case and use the new postfix notation
instead.

This fixes

    ./TEST -deparse op/array.t

which was using ->$#*.

6 years agoDeparse: handle \our @a
David Mitchell [Tue, 20 Mar 2018 09:51:37 +0000 (09:51 +0000)]
Deparse: handle \our @a

\our @a
was being deparsed as
\our(@a)

which incorrectly converts the \ from a scalar op to a list op

6 years ago[MERGE] Deparse fixups.
David Mitchell [Tue, 20 Mar 2018 09:28:23 +0000 (09:28 +0000)]
[MERGE] Deparse fixups.

Make
    ./TEST -deparse
pass again

6 years agoadd entries to Porting/deparse-skips.txt
David Mitchell [Mon, 19 Mar 2018 23:42:05 +0000 (23:42 +0000)]
add entries to Porting/deparse-skips.txt

Two test scripts are newly failing under
    ./TEST -deparse

op/array.t
    there are two issues:
    1)

        \our @a
        is getting deparsed as
        \our (@a)
        and so being misinterpreted as refgen rather than srefgen
    2)
        ->$#*
        isn't deparsed, so
        (\my @a)->$#*
        gets deparsed as
        $#{\my @a}
        with an incorrect scope for the my delcaration

lib/Config.t

    for some reason, some functions from ./lib/Config_heavy.pl
    are being output as part of lib/Config.t, and so things
    like strict throw a wobbly.
    Not sure yet why its happening

6 years agoDeparse.pm: bump version
David Mitchell [Mon, 19 Mar 2018 23:46:39 +0000 (23:46 +0000)]
Deparse.pm: bump version

6 years agoDeparse -l: set correct line num at end of sub
David Mitchell [Mon, 19 Mar 2018 20:35:26 +0000 (20:35 +0000)]
Deparse -l: set correct line num at end of sub

A sub declaration like

    sub f { ...}

will be deparsed under -l as

    #line 1 "foo"
    sub f {
    #line 1 "foo"
        ....
    }

which means that the closing '}' of the sub is incorrectly seen as being
on the next line.

This matters when a glob is created based on a sub being compiled: the
glob's gp_line field is set to the line containing the '}'.

This was causing some tests in ext/B/t/xref.t to fail under
    ./TEST -deparse

This commit causes an extra #line directive to be emitted:

    #line 1 "foo"
    sub f {
    #line 1 "foo"
        ....
    #line 1 "foo"   <=== NEW
    }

Whether xref.t failed depended on another factor. The optimisation
which created the GV for a just-compiled sub as an RV to a CV rather than
a GV to CV, causes the later-vifified GV (upgraded from an RV) to instead
have a gp_line corresponding to the first cop in the sub's body.

Arguably this difference (gp_line being set to the line number of first
line of the sub rather than the last line) is a bug, but it's not obvious
how to fix it, and I don't address it here.

However, the optimisation originally only applied to GVs in the main
stash;  it was later extended to all stashes but then reverted again,
in the sequence of commits

    v5.27.4-66-g6881372
    v5.27.4-127-g6eed25e
    v5.27.5-321-gd964025
    v5.27.8-149-g1e2cfe1

which caused xref.t to pass, then fail again.

6 years agoDeparse.pm: tr/...//c was failing
David Mitchell [Tue, 13 Mar 2018 12:20:03 +0000 (12:20 +0000)]
Deparse.pm: tr/...//c was failing

Deparsing a tr/....//c (complement and an empty replacement list)
was failing due to the 'delete RHS if LHS == RHS' action not triggering,
due the LHS having already been complemented.

At the same time, expand the set deparse tr/// tests;

6 years agoDeparse.pm: add some code comments
David Mitchell [Mon, 12 Mar 2018 12:20:23 +0000 (12:20 +0000)]
Deparse.pm: add some code comments

6 years agoDeparse: remove spurious tr/// debugging
David Mitchell [Sun, 11 Mar 2018 18:04:53 +0000 (18:04 +0000)]
Deparse: remove spurious tr/// debugging

I accidentally left a debugging print statement in after my recent tr///
work

6 years agoFix locale failures introduced 5 hours ago
Karl Williamson [Tue, 20 Mar 2018 02:52:25 +0000 (20:52 -0600)]
Fix locale failures introduced 5 hours ago

Commit 9fe4122e6defd7e9204ed6f2370d926d4c3b261b broke threaded builds
because it changed to free a global variable upon thread exit (I had
forgotten that it wasn't an interpreter variable).

I do not know why this passed before pushing; others have had trouble
reproducing it.  But the same tests were failing for me now.  The one
difference is that I had been using clang with address sanitizer
compiled in but turned off when I made that commit.  Now I'm using g++

Spotted by Dave Mitchell

6 years agoFirst draft of perldelta for 5.27.10
Todd Rinaldo [Tue, 20 Mar 2018 01:54:17 +0000 (20:54 -0500)]
First draft of perldelta for 5.27.10

6 years agoSpelling correction in perldiag.pod
Todd Rinaldo [Tue, 20 Mar 2018 01:49:35 +0000 (20:49 -0500)]
Spelling correction in perldiag.pod

6 years agoperl.c: Free some locale stuff on exit
Karl Williamson [Mon, 19 Mar 2018 22:00:21 +0000 (16:00 -0600)]
perl.c: Free some locale stuff on exit

This stops potential memory leaks when using POSIX 2008 locale handling,
by freeing the current locale object and two special ones.

6 years agolocale.c: Add detail to debugging statement
Karl Williamson [Mon, 19 Mar 2018 21:53:04 +0000 (15:53 -0600)]
locale.c: Add detail to debugging statement

so that it is easier to debug memory leaks.

6 years agolocale.c: Fix memory leak
Karl Williamson [Mon, 19 Mar 2018 21:36:56 +0000 (15:36 -0600)]
locale.c: Fix memory leak

This was caused by doing some initialization work out-of-order.  This
commit just moves some code to later in the function, revising some
comments to make sense after the move.

6 years agoUpdate File::Glob to 1.31 to account for changes in 5.27.10
Todd Rinaldo [Mon, 19 Mar 2018 21:33:52 +0000 (16:33 -0500)]
Update File::Glob to 1.31 to account for changes in 5.27.10

Includes:
 - C89 changes from Aaron Crane
 - Unit test timing fixes
 - Don't use loop: as a label to avoid struct loop confusion

6 years agoUpgrade Test-Harness from version 3.39 to 3.41
Todd Rinaldo [Mon, 19 Mar 2018 20:35:27 +0000 (15:35 -0500)]
Upgrade Test-Harness from version 3.39 to 3.41

[DELTA]

3.42    19-03-2018
        - Enable rulesfile.t to run in core

6 years agoFix locale problems on mingw
Karl Williamson [Sun, 18 Mar 2018 18:39:47 +0000 (12:39 -0600)]
Fix locale problems on mingw

Various symbols get exported (or not) by makedef.pl.  The determination
of some of the new ones is fairly complex in perl.h, and unfortunately
in general the code logic to do so must be copied into makedef.pl (until
a volunteer fixes this).  I thought I could avoid a bunch of this by
using the symbol ${^SAFE_LOCALES} which in fact was created so that
programs wouldn't have to know about this complexity.

The problem is that on Windows, miniperl is always compiled
single-thread and so locales are always safe, and so makedef.pl (which
is called by miniperl) got the wrong information.  The solution,
unfortunately, is to reproduce the complexity in makedef.pl

Spotted by Daniel Dragan.

6 years agoperlapi: bytes_to_utf8(), from_utf8(): Add clarification
Karl Williamson [Sun, 18 Mar 2018 18:38:39 +0000 (12:38 -0600)]
perlapi: bytes_to_utf8(), from_utf8(): Add clarification

The caller is responsible for freeing the memory used by these functions

6 years agoUpdate ExtUtils-MakeMaker to CPAN version 7.34
Chris 'BinGOs' Williams [Mon, 19 Mar 2018 11:08:13 +0000 (11:08 +0000)]
Update ExtUtils-MakeMaker to CPAN version 7.34

  [DELTA]

7.34  Mon Mar 19 10:21:12 GMT 2018

    No changes since v7.33_03

6 years agoUpgrade Test-Harness from version 3.39 to 3.41
Todd Rinaldo [Sun, 18 Mar 2018 20:19:36 +0000 (15:19 -0500)]
Upgrade Test-Harness from version 3.39 to 3.41

[DELTA]

3.41    27-02-2018
        - Released 3.40_01 without code modifications

3.40_01 23-07-2017
        - Return handle for pipes and sockets #58 (Erik Huelsmann)
        - TAP v13 plan allows trailing whitespace (Steffen Schwigon)
        - prove: add a --statefile=<path> option to customize the .prove file
          (Ævar Arnfjörð Bjarmason)
        - Avoid non-deterministic source handling, make a SourceHandler tie an
          error. (Michael Schwern, Leon Timmermans)
        - Fix and simplify MSWin32 colorization (Roy Ivy III)
        - Fix file source handler to accept single extensions option (Tomoki Aonuma)
        - Spelling fixes (Brian Wightman)

6 years agoMark CPAN changes for if/PathTools as irrelevant
Todd Rinaldo [Sun, 18 Mar 2018 22:08:27 +0000 (17:08 -0500)]
Mark CPAN changes for if/PathTools as irrelevant

There are no significant changes for these modules upstream. This change quiets
the tools that monitor for differences on CPAN.

6 years agoUpgrade Time::HiRes from version 1.9753 to 1.9757
Todd Rinaldo [Sun, 18 Mar 2018 22:08:21 +0000 (17:08 -0500)]
Upgrade Time::HiRes from version 1.9753 to 1.9757

[DELTA]

1.9577 [2018-03-15]
 - fix win32 (and cygwin?) builds which have been broken since 1.9755:
   problem was that gettimeofday() is a macro and needs to stay such
 - regenerate ppport.h with Perl 5.26.1 (was previously generated with
   5.25.6) and Devel::PPPort 3.35 (previously 3.36) -- this doesn't
   change the ppport.h, though

1.9756 [2018-03-14]
 - division by zero in new test tv_interval.t [rt.cpan.org #124775]:
   made the test pass even if the difference is zero, but also
   made it practically impossible to ever be zero by adding
   a sub-second sleep.
 - remove comments from inside qw [rt.cpan.org #124777],
   only seemed to be caught by Perl 5.18.4

1.9755 [2018-03-14]
 - adjust the error messages of tv_interval()
 - the NV_1EX constants now cast to be NV so that
   tv_interval() with long double builds does not
   produce ugly results [rt.cpan.org #106456]
 - add tests for tv_interval()
 - centralize the mygettimeofday() logic
 - make the mygettimeofday() a function instead of macro
 - add the OS X 10.12+ clock_gettime() constants
   CLOCK_MONOTONIC_RAW_APPROX CLOCK_UPTIME_RAW_APPROX
 - regenerate the fallback files

1.9754 [2018-02-16]
 - unify the gettimeofday() and time() forked code
   that had near identical code paths for MacOS Classic
   (which has two unusual features: unsigned time_t,
   and a special tz struct member), and for non-MacOS Classic
 - tv_interval should be implemented in XS
   [rt.cpan.org #106456]
   thanks to Sergey Aleynikov (suggested implementation simplified
   by the above-mentioned MacOS Classic simplification)

6 years agoUpgrade Encode from version 2.96 to 2.97
Todd Rinaldo [Sun, 18 Mar 2018 22:08:15 +0000 (17:08 -0500)]
Upgrade Encode from version 2.96 to 2.97

6 years agoUpgrade Locale::Codes from version 3.55 to 3.56
Todd Rinaldo [Sun, 18 Mar 2018 22:08:09 +0000 (17:08 -0500)]
Upgrade Locale::Codes from version 3.55 to 3.56

6 years agoUpgrade Scalar::Util from version 1.49 to 1.50
Todd Rinaldo [Sun, 18 Mar 2018 22:08:04 +0000 (17:08 -0500)]
Upgrade Scalar::Util from version 1.49 to 1.50

[DELTA]

1.50 -- 2018-02-20 19:13:27
[CHANGES]
* Added head() and tail() functions (thanks preaction)
* Support binary and Unicode in symbol names for set_subname()

[BUGFIXES]
* Fix building with C++ and C89 compilers
* Fix uniq() test for old Test::More
* Fix example get_code_info for unnamed subs (RT#116962)
* Fixes for symbol names containing ' characters
* Don't leak SVs from sum0/product1 when called with zero args (RT#124017)
* Use sv_rvunweaken() in Scalar::Util::unweaken() (thanks ilmari)
* Misc. fixes for perl 5.6

6 years agoUpgrade Test-Simple from version 1.302122 to 1.302133
Todd Rinaldo [Sun, 18 Mar 2018 22:07:59 +0000 (17:07 -0500)]
Upgrade Test-Simple from version 1.302122 to 1.302133

[DELTA]

1.302133  2018-03-11 12:48:37-07:00 America/Los_Angeles

    - No changes since last trial

1.302132  2018-03-09 15:43:51-08:00 America/Los_Angeles (TRIAL RELEASE)

    - Add method to validate facet data
    - Add Test2::Event::V2 event class, and context helpers
    - Improve how events handle facets
    - Break out meta_facet_data
    - Document and fix Facets2Legacy
    - Fix nested and in_subtest to look at hub facets
    - Fix event->related and trace with uuid

1.302131  2018-03-07 09:36:16-08:00 America/Los_Angeles (TRIAL RELEASE)

    - Make sure event puts the uuid into the about facet

1.302130  2018-03-07 08:07:54-08:00 America/Los_Angeles

    - No changes since last trial

1.302129  2018-03-06 13:43:22-08:00 America/Los_Angeles (TRIAL RELEASE)

    - Make hubs tag events with a new facet

1.302128  2018-03-05 09:26:53-08:00 America/Los_Angeles

    - No changes since the trial

1.302127  2018-03-02 12:43:56-08:00 America/Los_Angeles (TRIAL RELEASE)

    - Fix missing UUID in Test::Builder subtests

1.302126  2018-03-01 23:15:52-08:00 America/Los_Angeles (TRIAL RELEASE)

    - Add optional UUID tagging

1.302125  2018-02-21 23:10:39-08:00 America/Los_Angeles

    - No changes since trial

1.302124  2018-02-13 22:02:48-08:00 America/Los_Angeles (TRIAL RELEASE)

    - Fix a test to skip without threads

1.302123  2018-02-13 21:39:31-08:00 America/Los_Angeles (TRIAL RELEASE)

    - Make it possible to disable IPC

6 years agoUpgrade Time::Piece from vesion 1.3203 to 1.3204
Todd Rinaldo [Sun, 18 Mar 2018 22:07:45 +0000 (17:07 -0500)]
Upgrade Time::Piece from vesion 1.3203 to 1.3204

[DELTA]

1.3204  2018-02-19
        - Fix compilation warnings.

6 years agoSilence compilter warning
Karl Williamson [Fri, 16 Mar 2018 20:11:52 +0000 (14:11 -0600)]
Silence compilter warning

See thread beginning at
http://nntp.perl.org/group/perl.perl5.porters/244215

6 years agolocale.c: Clarify warning message
Karl Williamson [Fri, 16 Mar 2018 19:57:00 +0000 (13:57 -0600)]
locale.c: Clarify warning message

When there are discrepancies in the locale and what Perl is expecting, a
warning is raised listing the problematic characters.  For \n, and \t,
they should have been displayed as mnemonics, but a required backslash
to escape things had been omitted, so they were displayed literally, so
looked just like white space.  Also, put any displayed blank in ' ' so
it won't look like the list is empty.

6 years agolocale.c: Handle and edge case
Karl Williamson [Fri, 16 Mar 2018 19:53:48 +0000 (13:53 -0600)]
locale.c: Handle and edge case

setlocale(LC_ALL, "LC_foo=bar; LC_baz=gah") is legal.  Any categories
omitted in the string are set to "C".  Prior to this commit the omitted
categories were unchanged

6 years agoDon't include interpreter variable unless used
Karl Williamson [Thu, 15 Mar 2018 03:08:54 +0000 (21:08 -0600)]
Don't include interpreter variable unless used

This adds an #ifdef around this variable, so that it isn't defined
unless used.

Spotted by Daniel Dragan.

6 years agoMake Unicode data structures global
Karl Williamson [Wed, 14 Mar 2018 03:52:15 +0000 (21:52 -0600)]
Make Unicode data structures global

These structures are read-only, use const C strings, and are truly
global, so no need to have them be interpreter level.  This saves
duplicating and freeing them as threads come and go.

In doing this, I noticed that not every one was properly being
copied/deallocated, so this fixes some potential unreported bugs, and
leaks.

6 years agolocale.c: Silence Win32 compiler warning
Karl Williamson [Wed, 14 Mar 2018 14:39:59 +0000 (08:39 -0600)]
locale.c: Silence Win32 compiler warning

The return value is discarded here, and a few lines down calls this
function again, retaining its return value.

6 years agolocale.c: Add savepv() to setlocale() returns
Karl Williamson [Tue, 13 Mar 2018 18:08:16 +0000 (12:08 -0600)]
locale.c: Add savepv() to setlocale() returns

The next call to setlocale can overwrite the returned value from the
current call, depending on platform.  Therefore, one should save the
results.  I forgot this in commit 39e69e777b8.  Now fixing it.

I also audited locale.c to find any other instances.  There were several
where setlocale() is called without saving, and that return is passed to
a function.  It may work now, but it's dangerous to rely on the function
not getting changed in such a way as to do its own setlocale, expecting
the input parameter to be unchanged.  So save the returns from these as
well, as a precaution.

6 years agoperl_langinfo.h: Fix typo in comment
Karl Williamson [Mon, 12 Mar 2018 17:26:17 +0000 (11:26 -0600)]
perl_langinfo.h: Fix typo in comment

6 years agoperllocale: Update, clarify
Karl Williamson [Mon, 12 Mar 2018 18:42:23 +0000 (12:42 -0600)]
perllocale: Update, clarify

6 years agoperlapi/Perl_setlocale: Clarify
Karl Williamson [Mon, 12 Mar 2018 18:29:42 +0000 (12:29 -0600)]
perlapi/Perl_setlocale: Clarify

6 years agoFix comments/pod for LC_NUMERIC not always C
Karl Williamson [Mon, 12 Mar 2018 18:24:04 +0000 (12:24 -0600)]
Fix comments/pod for LC_NUMERIC not always C

In recent Perl versions, the underlying locale for LC_NUMERIC has been
kept in C because XS code is expecting a dot radix character.  But if
the LC_NUMERIC locale has a dot, that is unnecessary.  (There is also
the thousands grouping separator which for safety we verify is empty.)
Thus 5.27 doesn't always keep the underlying locale in C; it does so
only if necessary.

This commit updates various comments and pods to reflect this change.

6 years agot/lib/croak/regcomp: Fix up for EBCDIC
Karl Williamson [Mon, 12 Mar 2018 17:18:11 +0000 (11:18 -0600)]
t/lib/croak/regcomp: Fix up for EBCDIC

This skips the current ASCII-centric test on EBCDIC platforms, and adds
an equivalent test for just those.

6 years agoDon't use duplocale() unless is present
Karl Williamson [Wed, 7 Mar 2018 17:20:53 +0000 (10:20 -0700)]
Don't use duplocale() unless is present

Prior to this patch, the code assumed that if you have the other, more
significant, POSIX 2008 functions available, that duplocale was present
and correctly functioning too.

However, we found that there have been bugs in it, so that a hints file
or Configure probe might want to exclude just it.

6 years agolocale.c: Reduce too-large indent
Karl Williamson [Sun, 11 Mar 2018 20:48:38 +0000 (14:48 -0600)]
locale.c: Reduce too-large indent

6 years agoPOSIX.pod: Fix nit
Karl Williamson [Sun, 11 Mar 2018 20:47:58 +0000 (14:47 -0600)]
POSIX.pod: Fix nit

6 years agoperl.h: White-space, comment changes only
Karl Williamson [Sun, 11 Mar 2018 20:39:04 +0000 (14:39 -0600)]
perl.h: White-space, comment changes only

6 years agoWork around Microsoft threaded locale bug for localeconv()
Karl Williamson [Fri, 9 Mar 2018 19:53:13 +0000 (12:53 -0700)]
Work around Microsoft threaded locale bug for localeconv()

Prior to Visual Studio 2015, the localeconv() function only looks at the
global locale, not the per-thread one it should.  This works around this
by creating critical sections, switching to the global locale to call
localeconv(), then switching back.  For the most common usage, it avoids
the switch by parsing a string it generates that should contain the
desired substring.  This leaves the switch required for retrieving the
floating point grouping separator and the currency string, plus
POSIX::localeconv().  The first two could be avoided by extra code as
detailed in the pod for switch_to_global_locale(); patches welcome!

6 years agoperl.h: Move macros to earlier in the file
Karl Williamson [Fri, 9 Mar 2018 19:14:43 +0000 (12:14 -0700)]
perl.h: Move macros to earlier in the file

There should be no other differences

6 years agoperl.h: Refactor some #defines
Karl Williamson [Fri, 9 Mar 2018 04:57:52 +0000 (21:57 -0700)]
perl.h: Refactor some #defines

These put the defines dealing with locale critical sections in one
place, more logically set out.

6 years agoResync duplicated code in perl.h makedef.pl
Karl Williamson [Fri, 9 Mar 2018 18:25:58 +0000 (11:25 -0700)]
Resync duplicated code in perl.h makedef.pl

These had gotten out of sync