| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
The assumption is that most studied strings are fairly short, hence the pain
of the extra code is worth it, given the memory savings.
80 character string, 336 bytes as U8, down from 1344 as U32
800 character string, 2112 bytes as U16, down from 4224 as U32
|
|
|
|
|
| |
This allows more than one C<study> to be active at the same time.
It eliminates PL_screamfirst, PL_lastscream, PL_maxscream.
|
|
|
|
|
|
| |
study uses magic to call SvSCREAM_off() if the scalar is modified. Allocate it
its own magic type ('G' for now - pos magic is 'g'). Share the same "set"
routine and vtable as regexp/bm/fm (setregxp and vtbl_regexp).
|
|
|
|
|
|
|
|
| |
This is something that ‘sub foo :lvalue;’ declarations do. This brings
attributes.pm in line with them.
See commits fff96ff and 885ef6f, ticket #68758, and
<364E1F98-FDCC-49A7-BADB-BD844626B8AE@cpan.org>.
|
|
|
|
| |
I’m about to make changes to it.
|
|
|
|
|
| |
IPC::Open2::open2() is implemented as a thin wrapper around
IPC::Open3::_open3(), and hence is very tightly coupled to it.
|
|
|
|
|
| |
For threaded platforms, this reduces the object code size, and should slightly
reduce CPU usage.
|
|
|
|
| |
Hopefully this will get smoke reports to pass again on Windows.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a regression introduced since 5.14.0, by commit e0171a1a3.
The new Perl_hfree_next_entry function that that commit introduced
returns the value of the hash element, or NULL if there are none left.
If the value of the hash element is NULL, the two cases are indistin-
guishable.
Before e0171a1a3, all the hash code took null values into account.
mro_package_moved took advantage of that, stealing values out of a
hash and leaving it to the freeing code to delete the elements.
The two places that call Perl_hfree_next_entry (there was only one,
S_hfreeentries, with commit e0171a1a3, but the following commit,
104d7b699c, made sv_clear call it, too) were not accounting for NULL
values’ being returned, and could terminate early, resulting in mem-
ory leaks.
One could argue that the perl core should not be assigning nulls to
HeVAL, but HeVAL is part of the public API and there could be CPAN
code assigning NULL to it, too.
So the safest approach seems to be to modify Perl_hfree_next_entry’s
callers to check the number of keys and not to attribute a signifi-
cance to a returned NULL.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
6a077020aea1c5f0 extended the OP_AELEMFAST optimisation to lexical arrays.
Previously OP_AELEMFAST was only used as an optimisation for OP_GV, which is a
PADOP/SVOP.
However, by reusing the same opcode, and signalling (pad) lexical vs package,
it introduced a myriad of special cases, because OP_PADAV is a BASEOP (not a
PADOP), whilst OP_AELEMFAST is a PADOP/SVOP (which is larger).
Using two OP numbers allows each variant to have the correct OP flags in
PL_opargs. Both can continue to share the same C code.
|
|
|
|
| |
These all pass now as of commit b56985536ef7.
|
|
|
|
|
| |
Also, in Perl_sv_magic() merge the case for PERL_MAGIC_dbfile with the others
that return a NULL vtable.
|
| |
|
|
|
|
|
|
|
|
| |
This should reduce the complexity of code dealing with GVs, as they no longer
try to play several different incompatible roles.
(As suggested by Ben Morrow. However, it didn't turn out to be as
straightforward as one might have hoped).
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the 256 byte Boyer-Moore table was stored in the buffer of SvPVX()
after the raw string by extending the buffer.
Given that the scalar is alway upgraded to add PERL_MAGIC_bm magic, to clear
the table and other flags, there's no extra memory cost in using mg_ptr in the
MAGIC struct to point directly to the table.
I believe that this removes the last place in the core that stores data beyond
SvCUR().
|
|
|
|
|
|
|
| |
This reduces the complexity of the union declarations in sv.h.
As B.xs is accessing the structures/unions directly, instead of using the
macros, it needs a patch too.
|
| |
|
|
|
|
|
| |
No real-world code would ever end up using a studied scalar as a compile-time
second argument to index, so this isn't a real pessimisation.
|
|
|
|
|
| |
No real-world code would ever end up studying an FBM scalar, so this isn't a
real pessimisation.
|
| |
|
|
|
|
|
|
|
| |
The memory is used for part of the FBM state.
Tidy the order of conditions in the if() determining whether the IV/UV should
be shown.
|
|
|
|
|
|
|
| |
All three functions are private, undocumented, unexported, and un(ab)used by
any code on CPAN. The first two are used in only one place, so inline them.
The third was added in 8960aa876f446ad2, without adding any code which used it,
and it has remained unused ever since.
|
| |
|
| |
|
|
|
|
|
| |
As fh_is_fd() is now used in only one location, inline it. (This function isn't
exported, isn't documented, and isn't (ab)used by anything on CPAN.)
|
|
|
|
|
|
|
| |
IO::Handle accepts either, but open only accepts the latter.
In spawn_with_handles(), hoist the C<require Fcntl> into the only block that
needs it - this avoids loading Fcntl on Win32.
|
|
|
|
|
| |
As C<dup_of_out> is never set on the other two members of @handles, this will
allow code simplification.
|
|
|
|
| |
Switch to 3-arg open where code is changing.
|
| |
|
|
|
|
|
| |
Switch to 3-arg open where code is changing. Additionally, @_ can now be used
in place of @cmd.
|
|
|
|
|
| |
Also convert fileno BAREWORD to fileno \*BAREWORD. These will aid future
refactoring.
|
|
|
|
| |
This avoids having to re-assign to the scalars $dad_wtr and $dad_rdr.
|
|
|
|
|
|
|
|
|
| |
Previously it was passed in as a parameter by IPC::Open2::open2() and
IPC::Open3::open3(), each of which used C<calller> to find it. Move the use of
caller to one place.
It would also be possible to use C<caller> to eliminate the first parameter to
_open3(), but this would add more code than it removes, so doesn't seem wise.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Previously it would fail on Win32, because spawn_with_handles() would attempt
to duplicate all three, ignoring failures at this point, but then report
failure to close any as a fatal error, even if this was because the earlier
dup-ing had failed.
Also avoid a warning in the *nix code path in open3() if STDERR is localized
(and hence fileno STDERR is undefined).
|
|
|
|
|
| |
This allows testing of the (normally) Win32 and OS/2 specific code paths in
IPC::Open3::open3().
|
|
|
|
|
|
|
|
| |
The code for STDIN and STDOUT never ends up needing to duplicate a reference.
The code for STDERR can, because of the earlier special case code to save
STDOUT. It was special-cased to use fileno in commit 8b3e92c60014b4e7, in 1998.
This was before 3 argument open. With 3 argument open the special case can be
avoided.
|
|
|
|
| |
Previously it could only perform 2 argument open.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original bug was a request that errors be reported in the parent process,
with a TODO test, and then a patch that added the feature for the !DO_SPAWN
case, and removed the TODO. The *implication* of the bug report and the way the
original test was only TODO for the !DO_SPAWN case was that errors were
reported inconsistently between the two code paths of open3().
However, this is not the case - the DO_SPAWN path through open3() return a
(pseudo) PID (and no error) when asked to run a non-existent program. Hence
there is now a feature discrepancy between the alternative implementations,
which feels like a bug that should (ultimately) be addressed.
The original test could have expressed that more directly with one code path
and a TODO. The refactoring of bd29e8c290c68f4f failed to spot this, and
introduced new logic errors in the DO_SPAWN path - waitpid() should not be
called if $@ is set.
Set $pid outside the eval {} - this makes sure it is (re)set to undef if the
eval fails, instead of holding its previous (now bogus) value.
|
|
|
|
| |
keys doesn’t actually use it yet, but it will soon.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Opening a file handle to \$glob causes assertion failures
(under debugging) or hangs or other erratic behaviour without
debugging. This might even crash in some cases.
It never really worked properly, but it didn’t start hanging
apparently until 5.12.2 and 5.14.0.
|
| |
|
| |
|