Father Chrysostomos [Fri, 9 Sep 2011 05:35:44 +0000 (22:35 -0700)]
[perl #98204] Shared objects not destoryed
Jerry wrote:
> threads::shared objects stored inside other
> threads::shared structures are not properly destroyed.
> When a threads::shared object is 'removed' from a
> threads::shared structure (e.g., a hash), the object's
> DESTROY method is not called.
Later, he said:
> When PL_destroyhook and Perl_shared_object_destroy were
> added, the problem they were overcoming was that the
> destruction of each threads::shared proxy was causing the
> underlying shared object's DESTROY method to be called. The
> fix provided a refcount check on the shared object so that
> the DESTROY method was only called with the shared object
> was no longer in use.
>
> The above works fine when delete() and pop() are used,
> because a proxy is created for the stored shared object that
> is being deleted (i.e., the value returned by the delete()
> call), and when the proxy is destroyed, the object's DESTROY
> method is called.
>
> However, when the stored shared object is 'removed' in some
> other manner (e.g., setting the storage location to
> 'undef'), there is no proxy involved, and hence DESTROY does
> not get called for the object.
This commit fixes that by modifying sharedsv_scalar_store,
sharedsv_scalar_mg_free and sharedsv_array_mg_CLEAR.
Each of those functions now checks whether the current item being
freed has sub-items with reference counts of 1. If so, that means the
sub-item will be freed as a result of the outer SV’s being freed. It
also means that there are no proxy objects and that destructors will
hence not be called. So it pushes a new proxy on to the calling con-
text’s mortals stack. If there are multiple levels of nested objects,
then, when the proxy on the mortals stack is freed, it triggers
sharedsv_scalar_mg_free, which goes through the process again.
This does not fix the problem for shared objects that still exist
(without proxies) at global destruction time. I cannot make that
work, as circularities will cause new proxies to be created continu-
ously and pushed on to the mortals stack. Also, the proxies may end
up being created too late during global destruction, after the mor-
tals stack has been emptied, and when there is not enough of the run-
time environment left for destructors to run. That will happen if
the shared object is referenced by a shared SV that is not an object.
The calling context doesn’t know about the object, so it won’t fire
the destructor at the object-destroying stage of global destruction.
Detecting circularities is also problematic: We would have to keep
a hash of ‘seen’ objects in the shared space, but then how would we
know when to free that? Letting it leak would affect embedded
environments.
So this whole trick of creating mortal proxy objects is skipped during
global destruction.
Father Chrysostomos [Thu, 8 Sep 2011 05:43:34 +0000 (22:43 -0700)]
shared.xs: Refactor to simplify S_get_RV’s callers
Every function that calls S_get_RV needs this same incantation:
S_get_RV(aTHX_ sv, ssv);
/* Look ahead for refs of refs */
if (SvROK(SvRV(ssv))) {
SvROK_on(SvRV(sv));
S_get_RV(aTHX_ SvRV(sv), SvRV(ssv));
}
Also, S_get_RV keeps repeating SvRV(ssv), even though it assigns it to
sobj at the top.
Also, an upcoming commit will need the ability to pass the referent to
S_get_RV.
So this patch changes S_get_RV to accept a referent instead (eliminat-
ing its multiple use of SvRV) and adds a get_RV macro to take care of
the standard calling rite.
Mark Jason Dominus [Fri, 9 Sep 2011 05:18:47 +0000 (00:18 -0500)]
Simplify example pack code in perlpacktut
Father Chrysostomos [Fri, 9 Sep 2011 03:45:20 +0000 (20:45 -0700)]
Enter gv_fetchsv_nomg
There are so many cases that use this incantation to get around
gv_fetchsv’s calling of get-magic--
STRLEN len;
const char *name = SvPV_nomg_const(sv,len);
gv = gv_fetchpvn_flags(name, len, flags | SvUTF8(sv), type);
--that it’s about time we had a shorthand.
Ricardo Signes [Fri, 9 Sep 2011 02:52:09 +0000 (22:52 -0400)]
remove bogus < in B<> formatting code
Dave Rolsky [Fri, 9 Sep 2011 03:06:02 +0000 (22:06 -0500)]
add known issues for new OO docs
Dave Rolsky [Fri, 9 Sep 2011 03:04:12 +0000 (22:04 -0500)]
some small fixes to make porting/podcheck.t happy
Dave Rolsky [Fri, 9 Sep 2011 02:58:12 +0000 (21:58 -0500)]
Tweak line length of comment in verbatim section per podcheck.t
Dave Rolsky [Mon, 11 Jul 2011 02:58:33 +0000 (21:58 -0500)]
Lots of updates based on feedback from sprout, including a few new sections
Dave Rolsky [Sun, 10 Jul 2011 23:52:33 +0000 (18:52 -0500)]
Some changes based no sprout's feedback
Dave Rolsky [Fri, 8 Jul 2011 22:49:13 +0000 (17:49 -0500)]
fix now-broken link to removed section in perlobj
Dave Rolsky [Thu, 7 Jul 2011 19:32:59 +0000 (14:32 -0500)]
Add perldelta entries for all doc changes
Dave Rolsky [Thu, 7 Jul 2011 19:07:53 +0000 (14:07 -0500)]
Redo all examples using File and File::MP3
Dave Rolsky [Thu, 7 Jul 2011 18:45:45 +0000 (13:45 -0500)]
Remove all references to old OO tutorial docs, and add refs to perlootut where appropriate
Used buildtoc to regenerate pod-related files
Dave Rolsky [Thu, 7 Jul 2011 16:43:25 +0000 (11:43 -0500)]
remove all old OO tutorials (and perlbot)
Dave Rolsky [Thu, 7 Jul 2011 18:51:28 +0000 (13:51 -0500)]
Small revisions to the text to increase clarity, suggested by Philip Monsen
Dave Rolsky [Thu, 7 Jul 2011 15:47:35 +0000 (10:47 -0500)]
Add more details on inside-out objects from David Golden, and an inside-out class example from Abigail.
Add strict & warning to blessed scalar class example
Dave Rolsky [Thu, 7 Jul 2011 16:35:00 +0000 (11:35 -0500)]
heavily revised perlobj.pod
Dave Rolsky [Wed, 23 Mar 2011 15:38:28 +0000 (10:38 -0500)]
Use same list of "when to use OO" criteria in perlmodstyle as in perlootut
See my previous commit message for permission from ORA to use this text under
the same license as Perl itself.
Dave Rolsky [Wed, 23 Mar 2011 15:00:05 +0000 (10:00 -0500)]
Add Damian's list of when to use OO - copied from PBP
Here's the email from Teri Finn at O'Reilly giving us permission to do so:
-------------------------------------------------------------------------
Dave,
O'Reilly Media is happy to grant you the permissions you have requested below.
If you are able to include the copyright notice in the attribution that would be great.
Damian Conway wrote about when to use OO in Perl Best Practices, Copyright © 2004, Published by O'Reilly Media, Inc.
His list of criteria for doing so is:
Our best to you on your project.
Teri Finn
O'Reilly Media, Inc.
----- Original Message -----
From: "Dave Rolsky" <autarch@urth.org>
To: permissions@oreilly.com
Cc: damian@conway.org
Sent: Sunday, March 6, 2011 6:58:34 PM GMT -08:00 US/Canada Pacific
Subject: Usage of text from Perl Best Practices
Hi, ORA,
I'm working on the Perl 5 core documentation, specifically on a new OO
tutorial. I'd like to include Damian's "when to use OO" list as published
in Perl Best Practices (pages 320-321).
I don't want to include the entire text verbatim, just the bullet points.
I wrote to Damian and he is okay with having this included in the docs,
just as an FYI.
To do this, I'd need permission to include the text and distribute it
under the same license as Perl 5 itself, which is currently version 1 of
the Artistic license.
I would of course credit Damian and note the book, something like ....
Damian Conway wrote about when to use OO in Perl Best Practices. His
list of criteria for doing so is:
Thanks,
-dave
Dave Rolsky [Thu, 7 Jul 2011 16:36:37 +0000 (11:36 -0500)]
Check in new OO tutorial - perlootut
Father Chrysostomos [Fri, 9 Sep 2011 01:03:02 +0000 (18:03 -0700)]
ch(dir|mod|own) should not ignore get-magic on glob(ref)s
When the chdir(*handle) feature was added in 5.8.8, the fact that
globs and refs could be magical was not taken into account.
They can easily be magical if a typeglob or reference is returned from
or assigned to a tied variable.
Father Chrysostomos [Thu, 8 Sep 2011 21:51:07 +0000 (14:51 -0700)]
Call get-magic once for *glob=$tied
This is a regression in 5.10.0.
Chris 'BinGOs' Williams [Thu, 8 Sep 2011 14:54:31 +0000 (15:54 +0100)]
Update perlfaq to CPAN version 5.0150033
[DELTA]
5.0150033 Tue 30 Aug 2011 21:46:25 +0100
* Perl 6 changes (apeiron)
* Replace tabs with spaces (ranguard)
* Link to www.cpan.org/ports/ for binary (ranguard)
* Switch C<> over to L<> for any module on CPAN (ranguard)
* Change brace stype (apeiron)
* Extra dzil tests (rafl)
* Changes so more semantic, and better rendered HTML (ranguard)
* Point to repo for how to update perlfaq (ranguard)
Chris 'BinGOs' Williams [Thu, 8 Sep 2011 14:41:20 +0000 (15:41 +0100)]
Update Module-Load-Conditional to CPAN version 0.46
[DELTA]
Changes for 0.46 Wed Sep 7 23:57:03 BST 2011
=================================================
* Use || instead of "or" (perl#78708) (chorny)
Robin Barker [Wed, 7 Sep 2011 21:22:42 +0000 (22:22 +0100)]
remove unused variables and assignments
and silences some compiler warnings.
I do not understand the code in toke.c but the change aligns the code
with other uses of FUN0OP, it has no warnings and does not break any test.
Father Chrysostomos [Thu, 8 Sep 2011 07:02:39 +0000 (00:02 -0700)]
Suppress warning from tie_fetch_count.t
Tony Cook [Tue, 6 Sep 2011 13:45:02 +0000 (23:45 +1000)]
avoid " in Carp.t test programs, due to Win32 shell issues
Win32 doesn't have a real execv(), so the " end up in the
command-line, interfering with the normal quoted command-line
processing.
Father Chrysostomos [Thu, 8 Sep 2011 05:14:09 +0000 (22:14 -0700)]
Increase $attributes::version to 0.16
Keith Thompson [Mon, 5 Sep 2011 23:37:46 +0000 (16:37 -0700)]
Convert some files from Latin-1 to UTF-8
Chris 'BinGOs' Williams [Wed, 7 Sep 2011 22:18:03 +0000 (23:18 +0100)]
Update Module-Metadata to CPAN version 1.000007
[DELTA]
1.0.7 2001-09-07 12:00:00
- Apply VMS fixes backported from blead (Craig A. Berry)
Nicholas Clark [Wed, 7 Sep 2011 21:00:10 +0000 (23:00 +0200)]
In Dumper.xs, use sv_newmortal() instead of sv_mortalcopy(&PL_sv_undef).
The two produce identical results. The former is terser, and far more
efficient.
Nicholas Clark [Wed, 7 Sep 2011 20:30:52 +0000 (21:30 +0100)]
ODBM_File can use the same T_PTROBJ typemap as the other ?DBM_File modules.
This simplifies the RETVAL handling in TIEHASH, and makes the code closer
to the other 3 ?DBM_File modules. The difference in TIEHASH handling dates
back to 5.000, where only ODBM_File needed helper code around the dbm_open()
call. The other 3 were able to #define it as dbm_TIEHASH, and hence had no
CODE: section when first written.
Chris 'BinGOs' Williams [Wed, 7 Sep 2011 09:00:41 +0000 (10:00 +0100)]
Update Module-Metadata to CPAN version 1.000006
[DELTA]
1.0.6 2011-08-29 04:00:00
- Support PACKAGE BLOCK syntax (VPIT)
[Additional info]
Reapplied the changes made by Craig Berry for VMS in commit
63f27fd71dd22aa00021eb1e4fde4faa55ec9524
Raised [https://rt.cpan.org/Public/Bug/Display.html?id=70781] to
upstream these changes.
Nicholas Clark [Tue, 6 Sep 2011 13:06:06 +0000 (15:06 +0200)]
In Glob.xs, use memset() instead of bzero()
3c97495f56fb647c used bzero(), which isn't available on some platforms.
Karl Williamson [Fri, 2 Sep 2011 21:05:48 +0000 (15:05 -0600)]
Release managers guide changed to rmv stale perldeltas
We have decided to not deliver the BLEAD-POINT perldeltas, as their
information should have been consolidated into the BLEAD-FINAL
perldelta.
Karl Williamson [Mon, 29 Aug 2011 14:40:13 +0000 (08:40 -0600)]
Remove old odd-numbered releases perldeltas
The odd-numbered releases are for internal development, and their
individual perldeltas are collated togeter for the next even numbered
dot 0 release. This means that the individual perldeltas are no longer
useful once that dot 0 release is made, and they clutter things up,
giving duplicate information.
David Mitchell [Tue, 6 Sep 2011 11:16:23 +0000 (12:16 +0100)]
RT #4682: given() didn't scope $_ correctly
given(expr) {...} behaves similarly to { my $_ = expr; ...},
except that, prior to this commit, it wasn't doing the SAVECLEARSV()
that pp_padsv would do. This meant that $_ was still marked as stale
while in scope, and wasn't getting cleared at the end of scope.
Nicholas Clark [Tue, 6 Sep 2011 11:16:58 +0000 (13:16 +0200)]
S_op_integerize() needs a dVAR, else -DPERL_GLOBAL_STRUCT doesn't build.
Steffen Mueller [Tue, 6 Sep 2011 06:20:54 +0000 (08:20 +0200)]
ExtUtils::ParseXS: Fix INCLUDE: $cmd |
INCLUDE: $cmd | is the old, deprecated way of reading the output of
a command into a stream of XS code. Unfortunately, it was accidentally
broken by
fe7ae66bc2e4a8bbc90ba0d852e511116d6e97bb by replacing the
two-arg open with a three-arg open that opens in read-mode.
This change fixes the issue, reported as CPAN RT #70213.
Gerard Goossen [Sat, 20 Aug 2011 19:18:44 +0000 (21:18 +0200)]
Move non-constant folding parts of fold_constants into a separate functions.
The non-constant folding parts of fold_constants are moved into
separate functions. op_integerize handles converting ops to integer
(and special case of OP_NEGATE), op_std_init handling some standard
functionality (forced scalar context and allocating the TARGET).
Both functions are called where fold_constants is called (but we might
want to make that a bit some selective and use op_std_init in other
places).
Peter John Acklam [Mon, 5 Sep 2011 15:24:33 +0000 (08:24 -0700)]
[perl #98414] Update Math-BigInt-FastCalc to CPAN version 0.30.
Craig A. Berry [Mon, 5 Sep 2011 13:25:24 +0000 (08:25 -0500)]
No more special socket header handling for VMS.
This is necessary after
046cc26cf77f76bc63fd4d206fef560054f5d298,
which removed the special handling in vmsish.h. Building with
threads masked the need for the current change because reentr.h
also does the equivalent.
Shlomi Fish [Sun, 4 Sep 2011 19:29:59 +0000 (12:29 -0700)]
Add enable/disable commands for breakpoints in perl -d
Florian Ragwitz [Sun, 4 Sep 2011 23:50:58 +0000 (01:50 +0200)]
Fix a skip count in base's t/fields.t
Vincent Pit [Sun, 4 Sep 2011 22:11:24 +0000 (00:11 +0200)]
Pass -Idist/Carp/lib to miniperl
The build was broken by the move of Carp from lib to dist, because
miniperl calls perlmodlib.PL, perlmodlib.PL loads FindBin, and FindBin
wants Carp.
Chris 'BinGOs' Williams [Sun, 4 Sep 2011 20:47:29 +0000 (21:47 +0100)]
Update CPANPLUS-Dist-Build to CPAN version 0.58
[DELTA]
0.58 Sun Sep 4 20:42:48 BST 2011
- Added local::lib type behaviour detection to disable use of 'sudo'
Gerard Goossen [Sat, 3 Sep 2011 10:28:45 +0000 (12:28 +0200)]
Include negative index of array in warnings about an unitialized value wen constant folding isn't done.
When constant folding isn't done OP_NEGATE isn't merged with
a constant, and the index isn't detected when warning about
unintialized values. This patch adds special handling for OP_NEGATE to
the index detection.
Steffen Mueller [Sun, 4 Sep 2011 16:56:23 +0000 (18:56 +0200)]
Compare to newer ExtUtils::ParseXS from CPAN
Steffen Mueller [Sun, 4 Sep 2011 16:55:06 +0000 (18:55 +0200)]
ExtUtils::ParseXS: Allow users to enforce linkage of XSUBs
... using defines.
For easy backwards-compatibility of XS modules, we allow XS authors
to use
#define PERL_EUPXS_ALWAYS_EXPORT
or
#define PERL_EUPXS_NEVER_EXPORT
to choose one or the other behaviour. Since "always export" has been
the default behaviour of ExtUtils::ParseXS for virtually ever, defining
PERL_EUPXS_ALWAYS_EXPORT means that you get that behaviour in a very
backwards compatible way (barring a few broken EU::PXS releases).
Zefram [Sat, 3 Sep 2011 13:39:25 +0000 (14:39 +0100)]
improve Carp portability to earlier perls
* avoid vivifying globs in utf8::
* skip caller override completeness check if it would leak
* regularise format of Carp::Heavy for CPAN indexing
Zefram [Fri, 2 Sep 2011 23:54:36 +0000 (00:54 +0100)]
dual-life Carp
Make Carp portable to older Perl versions:
* check minimum Perl version (5.6) at load time
* use || instead of //
* attempt downgrading to avoid loading Unicode tables when that might fail
* check whether utf8::is_utf8() exists before calling it
* lower IPC::Open3 version requirement in Carp tests
Zefram [Wed, 31 Aug 2011 19:59:01 +0000 (20:59 +0100)]
move Carp to ext/Carp, preparing for dual-lifing
Nicholas Clark [Tue, 30 Aug 2011 10:48:43 +0000 (12:48 +0200)]
Remove WITH_THR() and WITH_THX(), which are not used.
grep.cpan.me and Google's codesearch find no use of WITH_THR or WITH_THX.
WITH_THX() was added in June 1999 in
cea2e8a9dd23747f, and the last user
eliminated with
0b250b9ef0d5134f in August 1999. WITH_THX() was used again
for DEBUG_CX() in
1c98cc53150c4860, and eliminated in
d9f81b50694a810f.
WITH_THR() was added in 1997 in
0f15f207c55ce70f. Use everywhere except
DEBUG_SCOPE() was eliminated in 2006 in
11206fddaf7ef068. WITH_THR() was
removed from DEBUG_SCOPE() in
d9f81b50694a810f.
Karl Williamson [Mon, 29 Aug 2011 15:15:52 +0000 (09:15 -0600)]
UCD.t: Add tests for sped-up lookups
This adds some tests for commit
5c3b35c95645d687026b198c24e884914bfb6ce6
Karl Williamson [Sat, 3 Sep 2011 19:47:19 +0000 (13:47 -0600)]
mktables: make_Heavy.pl smaller
During the time that mktables was being heavily revamped, Unicode
proposed a number of new properties whose names began with 'Is'. Perl
since 5.6 has alllowed properties to have an optional 'Is' prefix. Thus
there was the possibility that a new property name from Unicode would
conflict with one of Perl's name extensions. Thus, the code was written
to individually suppress such an extension when there was a conflict;
though this would be an undesirable state of affairs, where previously
working code would have to be changed due to a new Unicode release.
However, it turns out that other Unicode implementors had done the same
thing Perl had done, and the protests forced the new Unicode standard to
remove the 'Is' from the new properties; and apparently they won't try
to do this again.
However, the more general case code was still in mktables, doing no
harm, except enlarging significantly several of the hashes in Heavy.pl
to have essentially double the entries; one for the 'Is', and one
without. There have been some murmurings that Heavy.pl takes up too
much memory. Further, future commits are planned that would take up
space as well, and that could be made much smaller by not having the
individual basis for having Is/non-Is.
So, this commit takes away the individual property Is/non-Is and
replaces it with a blanket approach that has it for all Unicode
properties. This requires a single extra statement in utf8_heavy.
This has already been added mistakenly, but harmlessly, in commit
45376db692c38e06f27b8331d036652ec5fbb3d1
Note that perl extensions still have the individual Is/non-Is. This is
because the blanket approach won't work for them, as some of the 'Is'
synonyms do routinely get approaced in the case of the Block property.
It is documented that one shouldn't use the 'Is' prefix for the Block
property, because future Unicode versions could break your code.
Craig A. Berry [Sat, 3 Sep 2011 19:44:11 +0000 (14:44 -0500)]
Remove sockadapt layer from the VMS build.
SOCKETSHR is/was an interface to abstract out TCP/IP calls for the
various vendors' networking implementations, including the freeware
CMU-IP stack. Neither SOCKETSHR nor CMU-IP has seen any maintenance
for over a decade and are likely not even C89-compliant. The CRTL
socket routines have been supported by the different vendors' stacks
for many years so there is no reason to maintain an alternative, and
there probably hasn't been a real working alternative for some years
anyway.
The code is still there in maint-5.14 and earlier branches if
anyone has need of it.
Gerard Goossen [Tue, 9 Aug 2011 18:52:34 +0000 (20:52 +0200)]
Include name of global scalars in unitialized value warnings when the peephole optimiser isn't applied.
When the peephole optimiser isn't applied warnings about uninitialised
values from global scalars don't include the name of variable, because
the OP_RV2SV + OP_GV isn't converted to OP_GVSV. This patch fixes that
by extracting the name of the variable from the OP_RV2SV + OP_GV.
Father Chrysostomos [Sat, 3 Sep 2011 17:44:24 +0000 (10:44 -0700)]
Call get-magic once for CV-to-GV assignment
pp_rv2gv has already called get-magic, so pp_sassign should not do
it at all.
This is a regression from 5.8.8.
Jerry D. Hedden [Sat, 3 Sep 2011 15:10:43 +0000 (11:10 -0400)]
Upgrade to threads::shared 1.39
Jerry D. Hedden [Sat, 3 Sep 2011 15:05:08 +0000 (11:05 -0400)]
Upgrade to threads 1.85
Craig A. Berry [Sat, 3 Sep 2011 02:47:00 +0000 (21:47 -0500)]
perldelta entry for File:Glob / CVE-2011-2728 fix.
Craig A. Berry [Fri, 19 Aug 2011 15:14:13 +0000 (10:14 -0500)]
Plug segfault in bsd_glob() with unsupported ALTDIRFUNC flag.
First, disable all the unsupported flags just to make sure they aren't
triggering something they shouldn't be. Also, zero the pglob struct
before passing to bsd_glob(); it contains function pointers, and it's
safest if they are null rather than containing random stack data.
Bug reported by Clément Lecigne <clemun@gmail.com>.
Father Chrysostomos [Sat, 3 Sep 2011 05:03:06 +0000 (22:03 -0700)]
Bump threads(::shared) versions again
Since these numbers have already been used for developement releases,
they need to be changed again. I also added a note to make sure they
no longer get out of sync with the pod.
Jerry D. Hedden [Sat, 3 Sep 2011 03:28:00 +0000 (23:28 -0400)]
Upgrade to threads 1.84
Jerry D. Hedden [Sat, 3 Sep 2011 02:43:57 +0000 (22:43 -0400)]
Upgrade to threads::shared 1.38
Peter John Acklam [Fri, 2 Sep 2011 20:00:36 +0000 (13:00 -0700)]
[perl #98280] Use same version number 1.997 in all .pm files.
- For simplicity, use same version number 1.997 in all .pm files to match the
upcoming release 1.997 of the Math-BigInt distribution.
Karl Williamson [Fri, 2 Sep 2011 18:27:43 +0000 (12:27 -0600)]
perluniprops: Add note about 'L_' being non-standard
Karl Williamson [Fri, 2 Sep 2011 16:47:49 +0000 (10:47 -0600)]
utf8_heavy: Correctly handle \p{L_}
L_ is an old, discouraged but not deprecated, synonym for LC, cased
letters. It was improperly being converted to simply L, all letters,
because it is supposed to match loosely, and the trailing underscore was
being stripped. It needs a special case.
Tests passed for this, as the machine generated test case happened to
choose code points that are in both L and LC. Also some tests were
testing L instead of LC because of a similar flaw.
Karl Williamson [Fri, 2 Sep 2011 16:43:21 +0000 (10:43 -0600)]
perluniprops: display 2 synonyms as being discouraged
mktables was getting the display status from the overarching table,
instead of the synonym, for display in perluniprops.
Karl Williamson [Sun, 28 Aug 2011 18:52:49 +0000 (12:52 -0600)]
Unicode::UCD: clarify pod
Add a note, and reflow, that the data structure returned by this
function is unnecessarily complex, but is for compatibility with other
returns that need the complexity.
Karl Williamson [Sun, 28 Aug 2011 18:50:47 +0000 (12:50 -0600)]
Unicode::UCD: fix pod verbatim line length
Karl Williamson [Sun, 28 Aug 2011 18:40:37 +0000 (12:40 -0600)]
Unicode::UCD: speed up some look ups
A previous commit created the possibility that for a data structure to
be used instead of an array of arrays. The latter data structure is
used because most properties have long ranges in which each code point
maps to the same thing, and so don't have to have a hash entry for each
code point, can use the range as the base data structure. However
certain properties (or property-like structures) don't have long ranges,
and hence don't need to save memory by having things work through ranges
instead of individual code points. For these, a hash offers improved
speed, without the memory cost.
This patch converts 4 of the data structures to hashes. Future
extensions to this module will also take advantage of some of these
being in hashes
Karl Williamson [Sun, 28 Aug 2011 18:36:45 +0000 (12:36 -0600)]
Unicode::UCD: Allow for some look-up speed up
This changes the internal function to have an optional parameter to
return a hash instead of an array when the caller determines that it is
better to use a hash.
Karl Williamson [Sun, 28 Aug 2011 18:23:36 +0000 (12:23 -0600)]
Unicode::UCD: Use NFD(), not NFKD() for Hangul syllables
These decompositions are all canonical, not compatible only, so it gives
the same result, and I think it's clearer, explained in the revised
comment.
Karl Williamson [Sun, 28 Aug 2011 18:16:13 +0000 (12:16 -0600)]
Unicode::UCD Add synopsis info for num() to pod
Karl Williamson [Sun, 28 Aug 2011 18:08:04 +0000 (12:08 -0600)]
Unicode::UCD: Make pod header consistent
All the other function headers in this pod look like what this patch
makes this one look like. Corresponding links to it are also revised.
Nicholas Clark [Fri, 2 Sep 2011 11:47:57 +0000 (13:47 +0200)]
Remove Porting/genlog, redundant since the switch from Perforce to git.
"Generate a nice changelist by querying perforce" isn't much use these days.
Father Chrysostomos [Fri, 2 Sep 2011 04:26:24 +0000 (21:26 -0700)]
Silence two compiler warnings in gv.c
Father Chrysostomos [Thu, 1 Sep 2011 23:16:32 +0000 (16:16 -0700)]
Fix two \&$tied regressions
If the tied variable holds a reference, but changes to something else
when FETCH is called, perl crashes, as of commit
9d0f7ed75
(5.10.1/5.12.0):
sub ::72 { 73 };
sub TIESCALAR {bless[]}
sub STORE{}
sub FETCH { 72 }
tie my $x, "main";
$x = \$y;
\&$x;
That’s because commit
7a5fd60d4 caused double magic for one branch of
an if/else chain in sv_2cv (by using gv_fetchsv), so commit
9d0f7ed75
removed the SvGETMAGIC preceding the if/else, putting it inside each
branch. That meant that the type would be checked before get-magic
was called. So the type could change unexpectedly.
Due to another bug, this did not affect globs returned from tied array
elements, which got stringified, and hence worked in sv_2cv. But that
bug was fixed in 5.14.0 by commit
13be902ce, which allowed typeglobs
to be returned unflattened through elements of tied aggregates, caus-
ing this to stop working (‘Not a CODE reference’ instead of 73):
sub ::72 { 73 };
sub TIEARRAY {bless[]}
sub STORE{}
sub FETCH { 72 }
tie my @x, "main";
my $elem = \$x[0];
$$elem = *bar;
print &{\&$$elem}, "\n";
This commit fixes both issues by putting the SvGETMAGIC call
back where it belongs, above the if/else chain, and by using
SvPV_nomg_const and gv_fetchpvn_flags instead of gv_fetchsv, to avoid
an extra magic call.
Peter John Acklam [Thu, 1 Sep 2011 21:04:05 +0000 (14:04 -0700)]
[perl #98256] Add POD for the bsgn() method.
This stops Pod::Coverage (and possibly users)
from complaining about missing documentation.
Father Chrysostomos [Thu, 1 Sep 2011 20:57:21 +0000 (13:57 -0700)]
regen known_pod_issues.dat
Father Chrysostomos [Thu, 1 Sep 2011 20:52:05 +0000 (13:52 -0700)]
Bump Math::Big(In|Floa)t versions
Alexandr Ciornii [Thu, 1 Sep 2011 18:43:11 +0000 (21:43 +0300)]
remove incorrect formatting inside verbatim paragraphs
Alexandr Ciornii [Thu, 1 Sep 2011 17:59:17 +0000 (20:59 +0300)]
Correct links to sections (and modules in case of BigFloat.pm)
Nicholas Clark [Thu, 1 Sep 2011 21:00:32 +0000 (23:00 +0200)]
Reinstate the perldelta entry for CPANPLUS.
This was accidentally removed by commit
7ac26854bd1fc3c6. Oops.
Nicholas Clark [Thu, 1 Sep 2011 20:49:42 +0000 (22:49 +0200)]
Update AnyDBM_File's documentation to avoid use POSIX;
use Fcntl; is a much more efficient way to load the two constants needed.
Bring the joy of strict (and warnings) to AnyDBM_File, remove commented-out
code, and add __END__ to make it clear that there is no more code hiding
beyond the pod.
Father Chrysostomos [Thu, 1 Sep 2011 19:52:06 +0000 (12:52 -0700)]
Defenestrate PAD_DUP
It has been unused in core since
d5b1589c and is not used on CPAN.
Nicholas Clark [Thu, 1 Sep 2011 20:27:55 +0000 (22:27 +0200)]
Merge the POSIX.pm refactoring into blead.
POSIX.pm no longer uses AutoLoader, and is roughly halved in size, with no
change in functionality. Test coverage is improved.
Nicholas Clark [Thu, 1 Sep 2011 20:26:27 +0000 (22:26 +0200)]
Note the refactoring of POSIX.pm in perldelta.
Nicholas Clark [Thu, 1 Sep 2011 19:51:41 +0000 (21:51 +0200)]
Change the synopsis in POSIX.pod to stress use POSIX ();
Explicitly warn that the default of importing everything means that
use POSIX; has to import 553 symbols. Hence it's probably better to use
an explicit import list, or import nothing.
Nicholas Clark [Thu, 1 Sep 2011 19:32:13 +0000 (21:32 +0200)]
Generate @POSIX::EXPORT_OK from %reimpl, %replacement and an exception list.
This is considerably terser than listing all the entries for @EXPORT_OK
longhand. With this change we can no longer delete from %replacement in
AUTOLOAD(), as import() and load_imports() may be called after AUTOLOAD()
has already been run.
Nicholas Clark [Thu, 1 Sep 2011 18:07:51 +0000 (20:07 +0200)]
Test that @POSIX::EXPORT and @POSIX::EXPORT_OK are not inadvertently changed.
Nicholas Clark [Thu, 1 Sep 2011 17:00:03 +0000 (19:00 +0200)]
Remove isatty from @POSIX::EXPORT_OK, as it's already in @EXPORT.
This effectively reverts commit
d925a710473da185, which added it and
reformatted the source code. isatty was in (the generated) @EXPORT
at that time, hence there was never a need to add it.
Aristotle Pagaltzis [Wed, 31 Aug 2011 20:08:21 +0000 (22:08 +0200)]
Replace use of AutoLoader in POSIX with a custom compilation deferral scheme.
Nicholas Clark [Wed, 31 Aug 2011 13:20:56 +0000 (15:20 +0200)]
In POSIX, improve the diagnostic for the "use $method" instead.
In the error message, name the POSIX function that was called, as well as
the suggested replacement method. This rephrasing was in the patch
supplied by Aristotle Pagaltzis, but I have retained the existing POSIX
use of :: when describing the method, because given two less than great
choices, I'm inclined to favour retaining the status quo and one change
over two changes.
Aristotle Pagaltzis [Wed, 31 Aug 2011 12:59:57 +0000 (14:59 +0200)]
In POSIX, drastically simplify the wrappers for "unimplemented" functions.
Replace all the subroutines that croak() with a data structure and 8 lines in
POSIX::AUTOLOAD().
[By Aristotle Pagaltzis, with some editing by the committer, and most of his
message changes applied as a previous commit to split apart improvements from
pure refactoring]
This commit eliminates the helper functions POSIX::refef() and
POSIX::unimpl(), which were not part of the documented API, not exported,
and not used in any code outside the core (that is visible to Google
codesearch).
Aristotle Pagaltzis [Thu, 1 Sep 2011 08:49:05 +0000 (10:49 +0200)]
In POSIX.pm, modernise package variable style.
Nicholas Clark [Wed, 31 Aug 2011 12:32:47 +0000 (14:32 +0200)]
The more regular POSIX "unimplemented" diagnostics simplify the tests.
Nicholas Clark [Wed, 31 Aug 2011 11:08:49 +0000 (13:08 +0200)]
Improvements to the diagnostics for "unimplemented" POSIX functions.
Suggested by Aristotle Pagaltzis as part of a larger refactoring.
This regularises the text, changing '--use' and ': use' to ', use' to be
consistent, provides a message for POSIX::srand(), and adds ' is' to the
message for POSIX::bsearch().
Most of the diagnostics have been unchanged since perl 5.000. For some,
IO::Handle replaced FileHandle in perl5.003_20 (
28757baaaeaa3801).
div and ldiv's messages were improved to also mention % in 2003 by commit
7a6ca5fd18d88091.