summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* For shorter strings, store C<study>'s data as U8s or U16s, instead of U32s.Nicholas Clark2011-07-011-4/+53
| | | | | | | 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
* Store C<study>'s data in in mg_ptr instead of interpreter variables.Nicholas Clark2011-07-011-12/+24
| | | | | This allows more than one C<study> to be active at the same time. It eliminates PL_screamfirst, PL_lastscream, PL_maxscream.
* Split out study magic from pos magic.Nicholas Clark2011-07-011-4/+4
| | | | | | 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).
* attributes.pm: warn & don’t apply :lvalue to defined subsFather Chrysostomos2011-06-222-0/+13
| | | | | | | | 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>.
* Increase $attributes::version to 0.15Father Chrysostomos2011-06-221-1/+1
| | | | I’m about to make changes to it.
* Merge ext/IPC-Open2 into ext/IPC-Open3.Nicholas Clark2011-06-162-0/+0
| | | | | IPC::Open2::open2() is implemented as a thin wrapper around IPC::Open3::_open3(), and hence is very tightly coupled to it.
* Add PERL_NO_GET_CONTEXT to ODBM_FileNicholas Clark2011-06-162-1/+3
| | | | | For threaded platforms, this reduces the object code size, and should slightly reduce CPU usage.
* Move an XS::APItest var decl to PREINITFather Chrysostomos2011-06-121-1/+2
| | | | Hopefully this will get smoke reports to pass again on Windows.
* Completely free hashes containing nullsFather Chrysostomos2011-06-122-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix two broken URLs in mro.pm, bump version and document in perldeltaLeon Brocard2011-06-122-11/+4
|
* Reorder ops so that trans{,r} and aelemfast{,_lex} are adjacent.Nicholas Clark2011-06-121-1/+1
|
* Split OP_AELEMFAST_LEX out from OP_AELEMFAST.Nicholas Clark2011-06-123-5/+9
| | | | | | | | | | | | | 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.
* Remove TODO markers from Devel::Peek testsFather Chrysostomos2011-06-111-5/+18
| | | | These all pass now as of commit b56985536ef7.
* Replace references to PL_vtbl_{bm,fm} in the code with PL_vtbl_regexp.Nicholas Clark2011-06-111-2/+2
| | | | | Also, in Perl_sv_magic() merge the case for PERL_MAGIC_dbfile with the others that return a NULL vtable.
* Tests for Perl_get_vtbl()Nicholas Clark2011-06-112-0/+49
|
* Store FBMs in PVMGs, instead of GVs.Nicholas Clark2011-06-112-4/+4
| | | | | | | | 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).
* Store the BM table in mg_ptr instead of after SvCUR().Nicholas Clark2011-06-112-1/+22
| | | | | | | | | | | | 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().
* Abolish xbm_rare. Move BmUSEFUL() to union _xnvu and BmPREVIOUS() to the UV.Nicholas Clark2011-06-111-0/+5
| | | | | | | 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.
* Use SvTAIL() instead of BmFLAGS(). The core no longer uses BmFLAGS().Nicholas Clark2011-06-111-2/+0
|
* Don't fbm_compile() studied scalars, to give more flexibility in SV flag usage.Nicholas Clark2011-06-111-2/+18
| | | | | 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.
* Don't allow study on an FBM scalar, to give more flexibility in SV flag usage.Nicholas Clark2011-06-111-2/+24
| | | | | No real-world code would ever end up studying an FBM scalar, so this isn't a real pessimisation.
* Test dumping studied scalars.Nicholas Clark2011-06-111-1/+29
|
* Perl_do_sv_dump() shouldn't show "IV" for a FBM, as it's not valid.Nicholas Clark2011-06-111-0/+38
| | | | | | | 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.
* In IPC::Open3, inline xfork() and xclose_on_exec(), and delete xpipe_anon().Nicholas Clark2011-06-111-20/+7
| | | | | | | 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.
* In IPC::Open3::_open(), refactor the DO_SPAWN code to loop over @handles.Nicholas Clark2011-06-111-19/+9
|
* In IPC::Open3::_open(), refactor the fork/exec code to loop over @handles.Nicholas Clark2011-06-111-21/+10
|
* In IPC::Open3::_open(), refactor the common code into loops over @handles.Nicholas Clark2011-06-111-18/+20
| | | | | 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.)
* In IPC::Open3::_open(), switch from 'r' and 'w' to '<' and '>'.Nicholas Clark2011-06-111-4/+4
| | | | | | | 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.
* Use $handles[2]{dup_of_out} for the special case code for shared STD{OUT,ERR}.Nicholas Clark2011-06-111-5/+6
| | | | | As C<dup_of_out> is never set on the other two members of @handles, this will allow code simplification.
* In IPC::Open3::_open3(), move $kid_{rdr,wtr,err} to @handles.Nicholas Clark2011-06-111-29/+26
| | | | Switch to 3-arg open where code is changing.
* In IPC::Open3::_open3(), move $dup_{wtr,rdr,err} to @handles.Nicholas Clark2011-06-111-18/+18
|
* In IPC::Open3::_open3(), move $dad_{wtr,rdr,err} to @handles.Nicholas Clark2011-06-111-38/+41
| | | | | Switch to 3-arg open where code is changing. Additionally, @_ can now be used in place of @cmd.
* Move the table describing file handles near to the top of IPC::Open::open3().Nicholas Clark2011-06-111-22/+18
| | | | | Also convert fileno BAREWORD to fileno \*BAREWORD. These will aid future refactoring.
* Move the autovivification emulation code to the top of IPC::Open3::_open3().Nicholas Clark2011-06-111-7/+8
| | | | This avoids having to re-assign to the scalars $dad_wtr and $dad_rdr.
* Refactor IPC::Open3::_open3() to find the caller's package itself.Nicholas Clark2011-06-112-8/+7
| | | | | | | | | 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.
* IPC::Open3::open3() couldn't duplicate numeric file descriptors on Windows.Nicholas Clark2011-06-112-4/+24
|
* Avoid an uninitialized hash key in IPC::Open::spawn_with_handles().Nicholas Clark2011-06-112-8/+4
|
* IPC::Open3::open3() shouldn't fail if any of *STD{IN,OUT,ERR} are localized.Nicholas Clark2011-06-112-5/+32
| | | | | | | | | | 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).
* Add debug code to test IPC::Open3::spawn_with_handles() on *nix.Nicholas Clark2011-06-111-2/+23
| | | | | This allows testing of the (normally) Win32 and OS/2 specific code paths in IPC::Open3::open3().
* In IPC::Open3::_open(), use 3 argument open to avoid a special case for STDERR.Nicholas Clark2011-06-111-6/+3
| | | | | | | | 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.
* Generalise IPC::Open3::xopen() to $n-argument open.Nicholas Clark2011-06-111-2/+4
| | | | Previously it could only perform 2 argument open.
* Simplify the test for IPC::Open bug RT #72016.Nicholas Clark2011-06-111-10/+8
| | | | | | | | | | | | | | | | | | | | | 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.
* In B::Concise and op.h list all ops that use LVSUBFather Chrysostomos2011-06-091-1/+2
| | | | keys doesn’t actually use it yet, but it will soon.
* Test that IPC::Open{2,3} correctly fault read-only file-handle parameters.Nicholas Clark2011-06-062-2/+10
|
* Test that IPC::Open{2,3} correctly qualify file handles to their package.Nicholas Clark2011-06-062-2/+26
|
* In IPC-Open2.t, use functions other than ok(), to generate better diagnostics.Nicholas Clark2011-06-061-8/+6
|
* In IPC-Open3.t, merge two similar tests using a loop.Nicholas Clark2011-06-061-19/+9
|
* [perl #92258] <$fh> hangs on a glob copyFather Chrysostomos2011-06-051-3/+10
| | | | | | | | | 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.
* Make Devel::Peek::fill_mstats work on COWsFather Chrysostomos2011-06-042-0/+9
|
* Get PerlIO::scalar to write to COWsFather Chrysostomos2011-06-043-3/+12
|