summaryrefslogtreecommitdiff
path: root/sv.c
Commit message (Collapse)AuthorAgeFilesLines
* Check to see if there was a body which needs freeing using the old_type ↵Gerard Goossen2009-11-061-5/+5
| | | | instead of the arena flag, which is not set with PURIFY
* RT#69616: regexp SVs lose regexpness in assignmentBen Morrow2009-10-221-1/+8
| | | | | | | | It uses reg_temp_copy to copy the REGEXP onto the destination SV without needing to copy the underlying pattern structure. This means changing the prototype of reg_temp_copy, so it can copy onto a passed-in SV, but it isn't API (and probably shouldn't be exported) so I don't think this is a problem.
* Fix off-by-one error in e92c6be8349ad1d36d6df1dcb526fd37421e9970.Jan Dubois2009-10-211-2/+2
| | | | | | | This solves the curious crashes in op/fork.t that I'm seeing on *some* Windows machines. After locating the problem I'm surprised that not more machines run into these crashes, especially the smoke testers running on Windows 2000.
* Add Perl_ck_warner_d(), which combines Perl_ckwarn_d() and Perl_warner().Nicholas Clark2009-10-121-13/+9
| | | | | Replace ckWARN_d{,2,3,4}() && Perl_warner() with it, which trades reduced code size for 1 more function call if warnings are not enabled.
* Add Perl_ck_warner(), which combines Perl_ckwarn() and Perl_warner().Nicholas Clark2009-10-121-13/+11
| | | | | | | Replace ckWARN{,2,3,4}() && Perl_warner() with it, which trades reduced code size (about 0.2%), for 1 more function call if warnings are not enabled. However, if we're now in the L1 or L2 cache when we weren't previously, that's still going to be a speed win.
* Documentation typoRafael Garcia-Suarez2009-10-081-1/+1
|
* Don't attempt UTF-8 cache assertion for SVs with invalid SvPVX() (eg overloaded)Nicholas Clark2009-10-061-1/+7
| | | | | | | | Fixes RT 69422. However, I'm not actually sure whether we should even be caching the results of UTF-8 operations on overloading, given that nothing stops overloading returning a different value every time it's called.
* Remove obsolete interpreter variable PL_utf8_alnumcRafael Garcia-Suarez2009-09-131-1/+0
|
* convert a bunch of duplicated mortalization logic in sv.c into a private ↵Yves Orton2009-09-051-13/+15
| | | | file level macro
* add a note about the previous patches from gfxYves Orton2009-09-051-0/+12
|
* newSVpvn_flags() does mortalization in place, instead of calling sv_2mortal()gfx2009-09-051-2/+8
| | | | Signed-off-by: Yves Orton <demerphq@gemini.(none)>
* String with NULL auto-increment bug fixBo Borgerson2009-08-251-1/+1
| | | | | Check position relative to end of string length rather than whether char is NULL at end of initial alphanumerics in Perl_sv_inc
* Add clear magic to %^H so that the HE chain is reset when you empty it.Zefram2009-08-211-2/+3
| | | | This fixes [perl #68590] : %^H not lexical enough.
* Perl_newIO() can become a mathom by making newIO() a wrapper around newSV_type()Nicholas Clark2009-08-081-1/+15
| | | | and tweaking Perl_sv_upgrade().
* Move the "types are equal" early return ahead of the COW-removal.Nicholas Clark2009-08-081-3/+12
|
* in perl_clone_using, free the prt_tableDavid Mitchell2009-08-051-5/+6
| | | | | *after* we have called any CLONE methods (better fix for Variable::Magic than 240bfeb992)
* dup saved_curcop in PL_parserDavid Mitchell2009-07-261-0/+11
| | | | | | Commit 7c4baf47da introduced the saved_curcop field of PL_parser, but omitted to copy the entry during interpreter cloning. This may fix bugs [RT #58468], [RT #59498]
* mro::method_changed_in(..) ignores AUTOLOAD (RT #60220)Tony Cook2009-07-181-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Patch modified to use a boolean rather than an integer for tracking mro changes in S_glob_assign_ref and test fixed not to warn. URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60220 From the bug report: ----------------------------------------------------------------- When creating a subclass dynamically, and when adding AUTOLOAD dynamically into the parent class, then that AUTOLOAD is not seen in the method cache, even after a call to "mro::method_changed_in('Parent')". It only appears in the method cache after a call to mro::invalidate_all_method_caches(). The attached test file demonstrates the problem. This was detected while trying to solve bug 40159 in DBIx::DataModel. ----------------------------------------------------------------- Message-ID: <20081031132021.GA21341@mars.tony.develop-help.com>
* Allocate XPV* memory using sizeof() and the offset of the first real member.Nicholas Clark2009-07-171-58/+46
| | | | | | | | | | This avoids tripping over alignment differences between X* and x*_allocated, because x*_allocated doesn't have a double in it. Tidy up the documentation in comments. Eliminate relative_STRUCT_OFFSET() as it is no longer used. Eliminate use of xpv_allocated, xpviv_allocated, xpvav_allocated, xpvcv_allocated and xpvfm_allocated, but leave them in the headers as they are publicly visible.
* Eliminate struct regexp_allocated and xpvio_allocated.Nicholas Clark2009-07-171-6/+9
| | | | | | Calculate memory allocation using regexp and XPVIO, and the offset of the first real structure member. This avoids tripping over alignment differences between X* and x*_allocated, because x*_allocated doesn't have a double in it.
* Add a pluggable hook in op_free()Vincent Pit2009-07-081-0/+2
|
* Add test to make sure everything that outputs an exception or warning has a ↵James Mastros2009-06-271-2/+2
| | | | matching entry in perldiag (and fix it so that more of the existing ones do).
* Fix casting warningRafael Garcia-Suarez2009-05-311-2/+2
| | | | (that was introduced by 9ef5ed94af)
* Fix [RT#6266] -- sv_pos_u2b expects to be called with a valid character indexAlex Vandiver2009-05-301-2/+3
| | | | | | | sv_pos_u2b, when utf8 position caching is enabled, treats the uoffset it is given as real, storing it away for lature use. sprintf, here, passes the byte length of the string, which causes an invalid offset to be cached.
* Explicitely point to $. when it causes an uninitialized warning for ranges ↵Vincent Pit2009-05-261-0/+8
| | | | in scalar context
* Use only one block of memory for both PL_psig_name and PL_psig_ptr.Nicholas Clark2009-05-211-6/+4
|
* fix glob-assign for FORMATH.Merijn Brand2009-05-201-0/+1
|
* Remove binary compatibility scaffolding for the change to PL_bitcount.Nicholas Clark2009-05-201-1/+0
|
* Replace run-time on-demand initialisation of PL_bitcount with a constant table.Nicholas Clark2009-05-201-1/+1
| | | | | | | | | | | | | | | | (The table is 256 bytes; the run-time initialisation code is larger than this!) Adapt generate_uudmap.c to generate the initalisation block for PL_bitcount, writing the code to bitcount.h, using the same approach as uudmap.h. To preserve binary compatibility: for MULTIPLICITY: keep Ibitcount in the interpreter structure, but remove all the macros that access it. PL_bitcount is a new symbol in the object file, which won't clash with anything as that name wasn't used before. otherwise: keep PL_bitcount as a char *, but initialise it at compile time to a new constant array PL_bitcount array. Remove the code that attempts to Safefree() it at interpreter destruction time.
* In perl_clone_using(), use sv_dup_inc_multiple() to clone the temps stack.Nicholas Clark2009-05-191-6/+3
| | | | Avoid using Newxz() to zero allocate memory we will immediately overwrite.
* Add S_sv_dup_inc_multiple(), used in place of loops that call sv_dup_inc().Nicholas Clark2009-05-181-11/+24
| | | | Just 4 uses already give a size saving with gcc -Os.
* In perl_clone_using(), don't use Newxz() for arrays we immediately assign to.Nicholas Clark2009-05-181-2/+2
|
* In Perl_ptr_table_new(), fight back against the cult of Newxz().Nicholas Clark2009-05-181-1/+1
| | | | | (There's no need to zero-allocate memory for a structure when you're about to explicitly allocate every member.)
* Tidy the implementation of Perl_mg_dup().Nicholas Clark2009-05-181-25/+26
| | | | | | | | As all the structure elements are directly assigned to, use Newx() rather than Newxz(). Replace the explicit assignments with a direct structure copy. When reading values from the parent, read from those copied to the new structure, rather than the identical value in the old structure, to recduce CPU cache pressure.
* In Perl_mg_dup(), remove a branch by tracking the address to write to instead ofNicholas Clark2009-05-181-6/+4
| | | | the address of the structure, with a special case for the first time round.
* In Perl_mg_dup(), the while loop does the NULL check for us already.Nicholas Clark2009-05-181-4/+1
|
* In Perl_mg_dup(), don't call ptr_table_fetch, as we never call ptr_table_store.Nicholas Clark2009-05-181-4/+0
|
* Inline S_glob_2pv() into Perl_sv_2pv_flags(). (Existing bugs included.)Nicholas Clark2009-05-121-23/+17
| | | | Change 27942 missed this. (675c862fe1d4abfd048dce5f1958cca54b16c501)
* In Perl_gp_dup(), no need to explicitly zero ret->gp_refcnt after the Newxz().Nicholas Clark2009-05-041-1/+2
|
* Make Perl_hek_dup() cope with a NULL "source" parameter (by returning NULL).Nicholas Clark2009-05-041-4/+3
| | | | Change its callers to take advantage of this.
* Fix SEGVs when cloning a typeglob that has been undefined. (RT #64954)Nicholas Clark2009-05-041-1/+1
|
* Remove all #ifdef MACOS_TRADITIONAL code in core and non-dual-life XS code.Nicholas Clark2009-04-271-6/+0
| | | | | | | | (MacOS support was removed from MakeMaker in 6.22, and merged to blead on 15th December 2004 with 5dca256ec738057dc331fb644a93eca44ad5fa14. After this point MacOS wouldn't even have been able to build the perl binary, because it would not have been able to build DynaLoader. If anyone wishes to resurrect MacOS, start by reversing this commit and the relevant part of that commit.)
* In the context of PERL_OLD_COPY_ON_WRITE, remove comments about global mutexes.Nicholas Clark2009-04-191-12/+0
| | | | | These would only have been relevant if running under 5005 threads, which is long dead.
* GvUNIQUE* have been defined as 0 since 2005/06/30 - high time to remove them.Nicholas Clark2009-04-131-17/+1
|
* Change Perl_newCONSTSUB() so that a NULL sv generates an empty list return.Nicholas Clark2009-03-291-0/+3
| | | | Don't call DESTROY if it's a constant subroutine.
* Don't COW PVFMs, as the IVX is now used for FmLINES. (since change 34134)Nicholas Clark2009-03-281-1/+1
|
* fix a couple of comments that annoyingly look like merge conflict markersDavid Mitchell2009-03-061-2/+2
|
* The correct name of PERL_UTF8_magic is PERL_MAGIC_utf8, so use it in sv.c ↵Vincent Pit2009-02-071-3/+3
| | | | apidocs
* Optimize away calls to empty DESTROY methodsRafael Garcia-Suarez2009-01-201-1/+5
|
* Combine sv_utf8_upgrade with a following growKarl2009-01-191-1/+2
|