| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
| |
|
|
|
|
|
| |
for the upcoming y///r feature. There are not enough flag bits,
hence the extra type.
|
| |
|
|
|
|
|
|
|
| |
Only Perl_amagic_call() was using RvDEEPCP() when it was added in 5.000, and I
believe that it's never had any other users (in the core, on CPAN, or anywhere
else visible to Google codesearch). Hence it seems an ideal candidates to be
inlined and eliminated.
|
|
|
|
|
|
|
|
| |
Yes, it was a while loop implemented using goto, although this only became
clear by untangling the macros. I believe it need never have been implemented
as goto, given that the other user of tryAMAGICunW_var "broke" out of the
"if"'s block using a return, hence that "if" could have been a "while" all
along.
|
|
|
|
|
| |
Aside from the 2 callers where it can be replaced with AMG_CALLun().
AMG_CALLun_var was only used in core.
|
|
|
|
|
|
|
| |
This also inlines and eliminates FORCE_SETs and setAGAIN.
The three eliminated macros were not referenced from anywhere else. (The core,
CPAN, code visible to Google codesearch.)
|
|
|
|
|
| |
tryAMAGICunW was only used within pp.h itself, and not referenced from anywhere
else. (The core, CPAN, code visible to Google codesearch.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since commit 6f1401dc2acd2a2b, many AMAGIC macros in pp.h are no longer used
in core, nor in modules or CPAN, nor in code visible to Google codesearch.
Specifically:
tryAMAGICbinW_var
tryAMAGICbinW
tryAMAGICbin_var
tryAMAGICbin
tryAMAGICbinSET
tryAMAGICbinSET_var
tryAMAGICbinW_var
AMG_CALLbinL
tryAMAGICun_var
tryAMAGICun
tryAMAGICunSET_var
tryAMAGICunSET
tryAMAGICftest
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This avoids structure padding on architectures with 64 bit alignment for
pointers. For example, on x86_64 it reduces the structure size from 48 to 40
bytes.
|
| |
|
|
|
|
| |
I cheated by adding more commit IDs to the exception list.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
We don't actually know where in space a formatter will put
any text, or that the text will be there at all (e.g.
perldoc -v)
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
This fixes the DynaLoader related part of bug 78710
http://rt.perl.org/rt3//Public/Bug/Display.html?id=78710
|
|
|
|
|
|
|
| |
b2adfa9b5e1682df accidentally changed the return type from SV to B::SV.
Clearly there aren't enough tests.
However, the code prior to b2adfa9b5e1682df was buggy (now fixed) in that it
could put a NULL on the perl stack. The stack should only be valid SV pointers.
|
|
|
|
|
|
|
|
| |
1: Express B::amagic_generation and B::comppadlist "longhand", rather than
creating macros solely for the benefit of xsubpp.
2: As no functions remain needing prefix stripping, eliminate the MODULE
definition for B with the PREFIX of B_.
3: Merge the two BOOK blocks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) compress
if (...)
flag |= 1
...
if (flag & 1) {
...
into
if (...) {
flag |= 1
....
2) re-order the flag bits, since over the years some bits have become
redundant.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was some buggy code in Perl_sighandler() related to getting an SV
with the signal name to pass to the perl-level handler function.
`
Basically:
on threaded builds, a sig handler that died leaked PL_psig_name[sig];
on unthreaded builds, in a recursive handler that died, PL_sig_sv was
prematurely freed.
PL_sig_sv was originally just a file static var that was not
recursion-save anyway, and got promoted to perlvars.h when it should
instead have been done away with. So I've got rid of it now, and
rationalised the code, which fixed the two issues listed above.
Also added an assert which makes the dodgy manual popping of the save
stack slightly less dodgy.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Freeing lots of weak RVs to the same object results in quadratic
search through the backrefs array. This is probably sufficiently rare
that its not worth the expense of replacing the array with a ptr table
(say); but in the meantime, this patch makes the code as tight as
possible, and adds a check for the sv being at element 0, so that
both types of linear create/destroy order are optimised (previously only
created last / deleted first order was quick). It's still slow for random
deletion order. The RT code, modified to give high-res timing for the
return from the sub, and with various types of destruct order, gives the
following timings:
LIFO FIFO random
before 0.05s 17.37s 17.28s
now 0.04s 0.04s 12.05s
|
|
|
|
| |
On this platform this reduces the object size by 4.5K.
|
|
|
|
| |
This commit brought to you by the campaign for elimination of strlen().
|
|
|
|
|
|
|
|
|
| |
Change op_names_init() to use memset() rather than a longhand loop, and to
call put_op_bitspec() with an explicit length by using STR_WITH_LEN().
As all calls to put_op_bitspec() now pass in a length, remove the code to call
strlen() if the passed-in length is zero.
This commit brought to you by the campaign for elimination of strlen().
|
|
|
|
|
|
|
|
| |
This allows their only caller, Storable::_store(), to be simplified, as $ret
will now have the correct values for its documented interface.
Also, replace C<$ret = undef> with C<undef $ret>, as the latter is equivalent,
but uses 1 fewer op.
|
|
|
|
| |
On this platform, this reduces the object code size by around .75K.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The logic remains:
1: If the close fails, set $ret to undef, and attempt to unlink the file
2: If the eval set $@, attempt to unlink the file
3: If the unlink is attempted and fails, warn
However, the new code avoids using low-precedence or and a statement modifier,
both for flow control, in the same statement, which I certainly found confusing.
It also now avoids the implicit *three*-state logic for $ret, which previously
was attaching distinct meanings to true, false and undefined.
The new code has (some) flow control inside an if(), and enters a block (which
it seems that the old code strove hard to avoid - blocks are a small runtime
cost). However the block entry is only for the error case, so this should not
matter.
|
|
|
|
| |
It no longer serves much purpose, as of 7311f41d6.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All built-in functions that operate directly on array or hash
containers now also accept hard references to arrays or hashes:
|----------------------------+---------------------------|
| Traditional syntax | Terse syntax |
|----------------------------+---------------------------|
| push @$arrayref, @stuff | push $arrayref, @stuff |
| unshift @$arrayref, @stuff | unshift $arrayref, @stuff |
| pop @$arrayref | pop $arrayref |
| shift @$arrayref | shift $arrayref |
| splice @$arrayref, 0, 2 | splice $arrayref, 0, 2 |
| keys %$hashref | keys $hashref |
| keys @$arrayref | keys $arrayref |
| values %$hashref | values $hashref |
| values @$arrayref | values $arrayref |
| ($k,$v) = each %$hashref | ($k,$v) = each $hashref |
| ($k,$v) = each @$arrayref | ($k,$v) = each $arrayref |
|----------------------------+---------------------------|
This allows these built-in functions to act on long dereferencing
chains or on the return value of subroutines without needing to wrap
them in C<@{}> or C<%{}>:
push @{$obj->tags}, $new_tag; # old way
push $obj->tags, $new_tag; # new way
for ( keys %{$hoh->{genres}{artists}} ) {...} # old way
for ( keys $hoh->{genres}{artists} ) {...} # new way
For C<push>, C<unshift> and C<splice>, the reference will auto-vivify
if it is not defined, just as if it were wrapped with C<@{}>.
Calling C<keys> or C<values> directly on a reference gives a
substantial performance improvement over explicit dereferencing.
For C<keys>, C<values>, C<each>, when overloaded dereferencing is
present, the overloaded dereference is used instead of dereferencing
the underlying reftype. Warnings are issued about assumptions made in
the following three ambiguous cases:
(a) If both %{} and @{} overloading exists, %{} is used
(b) If %{} overloading exists on a blessed arrayref, %{} is used
(c) If @{} overloading exists on a blessed hashref, @{} is used
|
|
|
|
|
|
|
|
| |
This also happens to apply to *{ $::{glob} }, but not to *{\*glob} or
*{$thing = *glob}.
In other words, it’s only when the operand is a real glob, and not a
reference or a SVt_FAKE glob.
|
|
|
|
|
|
|
|
|
|
|
| |
[DELTA]
0.224 20101031
. Change assignment @ISA = (@ISA, 'new::class')
to use push @ISA, 'new::class'
This should make class creation faster from 5.10 onwards
and reverts a change made in 2.14. If this is critically slow for you
and you can't upgrade your version of Perl, use the old way.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
ANYOF_RUNTIME() is no longer used, so can be removed.
I had long tried to figure out what the purpose of this was, and
discovered it really had none.
I think it must have had something to do with locales at one time. But
locales don't do well with utf8, and I don't know how to make it better.
In any event this wasn't actually accomplishing anything.
|