summaryrefslogtreecommitdiff
path: root/sv.h
Commit message (Collapse)AuthorAgeFilesLines
* Allow lvalue usage of SvRV() and add MUTABLE_SV() check.Marcus Holland-Moritz2008-11-101-1/+13
| | | | | Also add new SvRV_const() macro for read-only access. p4raw-id: //depot/perl@34804
* Revert SvPVX() to allow lvalue usage, but also add aMarcus Holland-Moritz2008-11-071-1/+1
| | | | | | | MUTABLE_SV() check. Use SvPVX_const() instead of SvPVX() where only a const SV* is available. Also fix two falsely consted pointers in Perl_sv_2pv_flags(). p4raw-id: //depot/perl@34770
* Correct SvVALID() and SvTAIL() - they are actually const.Nicholas Clark2008-10-271-2/+2
| | | p4raw-id: //depot/perl@34613
* Add a macro MUTABLE_PTR(p), which on (non-pedantic) gcc will not castNicholas Clark2008-10-271-41/+41
| | | | | | | | | | away const, returning a void *. Add MUTABLE_SV(sv) which uses this, and replace all (SV *) casts either with MUTABLE_SV(sv), or (const SV *). This probably still needs some work - assigning to SvPVX() and SvRV() is now likely to generate a casting error. The core doesn't do this. But as-is it's finding bugs that can be fixed. p4raw-id: //depot/perl@34605
* Update copyright years.Nicholas Clark2008-10-251-2/+2
| | | p4raw-id: //depot/perl@34585
* Add SV allocation tracing to -Dm and PERL_MEM_LOGMarcus Holland-Moritz2008-10-241-0/+1
| | | | | Message-ID: <20081022013731.23b5a2e5@r2d2> p4raw-id: //depot/perl@34568
* Abolish xfm_lines from struct xpvfm. structs xpvfm and xpvcv are nowNicholas Clark2008-07-121-4/+2
| | | | | identical. p4raw-id: //depot/perl@34134
* PVFMs don't need to access the IVX any more. (as of change 32836, whichNicholas Clark2008-07-121-0/+2
| | | | | re-implemented SvOOK() to avoid using it) p4raw-id: //depot/perl@34133
* Re: [PATCH] More COW lvaluesReini Urban2008-06-091-1/+1
| | | | | | Message-ID: <484D491D.9050704@x-ray.at> Date: Mon, 09 Jun 2008 17:15:41 +0200 p4raw-id: //depot/perl@34038
* Re: [PATCH] readable assertion names, now sv.hReini Urban2008-06-081-90/+90
| | | | | | From: "Reini Urban" <rurban@x-ray.at> Message-ID: <6910a60806080626kfda0dd1ja906513e8fd0aa39@mail.gmail.com> p4raw-id: //depot/perl@34031
* Define sv_insert() as a wrapper to sv_insert_flags(), and moveNicholas Clark2008-04-011-0/+3
| | | | | Perl_sv_insert() to mathoms.c p4raw-id: //depot/perl@33627
* Fix bit-fields for VC [was RE: [perl #50386] GIMME_V broken with 5.10.0/GCC ↵Jan Dubois2008-02-121-4/+4
| | | | | | | | and XS?] From: "Jan Dubois" <jand@activestate.com> Message-ID: <02ee01c8651b$17ef72f0$47ce58d0$@com> p4raw-id: //depot/perl@33292
* Standardise the conditional compilation protection of ({}) fromNicholas Clark2008-01-261-2/+2
| | | | | | | | | #if defined(__GNUC__) && !defined(__STRICT_ANSI__) && !defined(PERL_GCC_PEDANTIC) to #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) because the ({}) construction can be used under __STRICT_ANSI__ (and should be, because it avoids temporary use of PL_Sv). p4raw-id: //depot/perl@33077
* PVIOs don't need space for SvNVX allocated.Nicholas Clark2008-01-251-28/+40
| | | p4raw-id: //depot/perl@33069
* For 5.12: saner behaviour for `length`Nicholas Clark2008-01-121-0/+2
| | | | | | (Make C<length undef> return undef). Patch mostly by Rafael, with some fine tuning by me. p4raw-id: //depot/perl@32969
* With regexps stored as real RVs, we can eliminate SvREPADTMP().Nicholas Clark2008-01-081-12/+2
| | | | | Exterminate! Exterminate! Exterminate! p4raw-id: //depot/perl@32902
* Clarify the use of SVf_BREAK on PL_reg_curpm.Nicholas Clark2008-01-071-1/+3
| | | p4raw-id: //depot/perl@32895
* Make REGEXP a type distinct from SV. (Much like AV, CV, GV, HV).Nicholas Clark2008-01-051-0/+5
| | | p4raw-id: //depot/perl@32861
* In struct regexp move the member paren_names to the IV union.Nicholas Clark2008-01-051-0/+1
| | | p4raw-id: //depot/perl@32854
* BER is all very well, but it turns out that it's better to store theNicholas Clark2008-01-051-6/+63
| | | | | | | | offset as either a byte (if <256), or a 0 byte with a STRLEN before. "better" in that the reading can be inlined, and even then the object code is smaller (function calls have space overhead). So goodbye Perl_sv_read_offset() and hello SvOOK_offset(). p4raw-id: //depot/perl@32838
* Re-implement the SvOOK() hack to store the offset as a BER encodedNicholas Clark2008-01-041-5/+12
| | | | | | | | | | | number in the part of the PVX that is being released. (It will always fit, as chopping off 1 byte gives just enough space for recording a delta of up to 127). This allows SvOOK() to co-exist with SvIOK_on(), which means all the calls to SvOOK_off() [with the possibility of a call to sv_backoff()] in SvIOK_on() can be removed. This ought to make a lot of straight line code a little bit simpler. OOK()d scalars can now be SVt_PV, as the IVX isn't needed. p4raw-id: //depot/perl@32836
* Missed three sv_2mortal(newSVpvn(...))s in the headers.Nicholas Clark2008-01-031-1/+1
| | | p4raw-id: //depot/perl@32820
* Add a new function newSVpvn_flags(), which takes a third parameter ofNicholas Clark2008-01-021-0/+11
| | | | | | | | | | flag bits. Right now the only flag bit is SVf_UTF8, which will call SvUTF8_on() on the new SV for you. Provide a wrapper newSVpvn_utf8(), which takes a boolean, and passes in SVf_UTF8 if that is true. Refactor the core to use it where possible. It makes the source code clearer and smaller, but seems to be swings and roundabouts on object code size. p4raw-id: //depot/perl@32807
* Make struct regexp the body of SVt_REGEXP SVs, REGEXPs become SVs,Nicholas Clark2008-01-021-6/+0
| | | | | | and regexp reference counting is via the regular SV reference counting. This was not as easy at it looks. p4raw-id: //depot/perl@32804
* factor out duplicate code in struct xpv*Marcus Holland-Moritz2007-12-301-305/+86
| | | | | Message-ID: <20071229181742.1933db40@r2d2> p4raw-id: //depot/perl@32783
* Include SVf_UTF8 in the bitmask when checking the SvFLAGS inMarcus Holland-Moritz2007-12-301-1/+1
| | | | | | SvPVutf8_force(), as otherwise the conditional expression will always be false and the optimisation will never kick in. p4raw-id: //depot/perl@32781
* First class regexps.Nicholas Clark2007-12-281-1/+32
| | | p4raw-id: //depot/perl@32751
* SvPVX_const() triggers an assertion that when the sv isn't a PV.Steve Peters2007-12-281-1/+1
| | | | | | Back this down to just checking to see if the sv is a PV or not. p4raw-id: //depot/perl@32750
* Take code that occurs in three places to take a scalar and ready it toNicholas Clark2007-12-261-0/+14
| | | | | hold a reference, and convert it to a macro define prepare_SV_for_RV(). p4raw-id: //depot/perl@32737
* Eliminate SVt_RV, and use SVt_IV to store plain references.Nicholas Clark2007-12-261-8/+12
| | | | | This frees up a scalar type for first class regular expressions. p4raw-id: //depot/perl@32734
* Swap SVt_RV and SVt_NV in the SV ordering.Nicholas Clark2007-12-261-4/+4
| | | p4raw-id: //depot/perl@32725
* In SvPV_free(), assert() that no-one is trying to free up a reference.Nicholas Clark2007-12-231-0/+1
| | | p4raw-id: //depot/perl@32717
* Bug fix for storing shared objects in shared structuresJerry D. Hedden2007-11-081-0/+1
| | | | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510711061136t52a1fe62waf384c4551612181@mail.gmail.com> (core patch only) p4raw-id: //depot/perl@32241
* Nothing is using IoSUBPROCESS() so eliminate xio_subprocess.Nicholas Clark2007-10-011-3/+1
| | | | | | Make xio_flags a U8, which is what it should have been all along (rather than a char, which might be signed). B.xs had its wrapper as U8 p4raw-id: //depot/perl@32001
* Under -DDEBUGGING (on gcc), assert that SvRV(sv) is being called onNicholas Clark2007-09-231-2/+16
| | | | | a valid SvTYPE(). p4raw-id: //depot/perl@31941
* Add some information to the comments describing SV flag bits.Nicholas Clark2007-07-011-1/+6
| | | p4raw-id: //depot/perl@31512
* Also get copy on write working with ithreads. It hadn't been workingNicholas Clark2007-06-241-1/+3
| | | | | | | since change 26684 (which uses sv_setsv_flags to copy a value from an SV in one interpreter context to an SV in another), despite what change 31120 thought. ext/Compress/Raw/Zlib/t/07bufsize.t still fails. p4raw-id: //depot/perl@31454
* Where possible, use SvIV instead of SvIVX, SvNV instead of SvNVX,Nicholas Clark2007-04-211-7/+11
| | | | | | | | | SvUV instead of SvUVX, and SvPV* variants instead of SvPVX*. Document that the non-x variants are preferable whenever the expression has no side effects. (Compilers perform common subexression elimination). Likewise SvREFCNT_inc simple variants are valid for all cases apart from expressions with side effects. p4raw-id: //depot/perl@31010
* Wrap the SvTYPE macro definition in parens.Rafael Garcia-Suarez2007-02-071-1/+1
| | | p4raw-id: //depot/perl@30153
* Fix a typo and some doubled spaces in comments.Nicholas Clark2007-01-221-3/+3
| | | p4raw-id: //depot/perl@29922
* Make PERL_OLD_COPY_ON_WRITE build again. Inline Perl_sv_release_IVX().Nicholas Clark2007-01-171-2/+2
| | | | | (Currently it fails ext/Compress/Raw/Zlib/t/07bufsize.t) p4raw-id: //depot/perl@29853
* Change the API doc for some of the SvXXX testing macros.Rafael Garcia-Suarez2007-01-081-24/+24
| | | | | | | Often, those macros simply test a bit in sv_flags, so the return value should be assigned to a U32 instead of a bool to avoid truncation. (bug perl #32884) p4raw-id: //depot/perl@29718
* Rename OURSTASH to SvOURSTASH and OURSTASH_set to SvOURSTASH_set.Nicholas Clark2007-01-031-2/+2
| | | p4raw-id: //depot/perl@29679
* Update copyright years to include 2007. (Plus a couple of 2006s andNicholas Clark2007-01-021-1/+1
| | | | | earlier we missed in av.h and hv.h) p4raw-id: //depot/perl@29670
* Remove the vestigal "#if 0"s from header files that defined same-sizedNicholas Clark2007-01-021-8/+0
| | | | | *allocated structs, as these are not going to be needed again. p4raw-id: //depot/perl@29664
* Move SVt_BIND to be the lowest type after SVt_NULL. This will force allNicholas Clark2006-12-311-5/+7
| | | | | | | | | code attempting to upgrade a BIND to anything into sv_upgrade(), which for now will croak, but in future can DTRT, for whatever TRT is decided to be. Make SvOK() check the flags of the referenant for a BIND, as I envisage that the only flag bit that will get set on a BIND is SVf_UTF8 even if the referant has a defined value. p4raw-id: //depot/perl@29642
* Eliminate BmPREVIOUS_set - with the complexity gone from how the datumNicholas Clark2006-12-281-2/+0
| | | | | is stored, there's no need for it. p4raw-id: //depot/perl@29635
* Move all the FBM data fields from the table into a struct xbm_s whichNicholas Clark2006-12-281-46/+63
| | | | | is part of the xnv union. p4raw-id: //depot/perl@29634
* Move the low/high cop sequences from NVX/IVX to a two U32 structureNicholas Clark2006-12-281-0/+36
| | | | | | in the xnv union. This frees up IVX for the PL_generation code, which in turn will allow SvCUR to return to its real purpose. p4raw-id: //depot/perl@29630
* Silence an unused variable warning in sv.c.Steve Peters2006-12-221-9/+7
| | | p4raw-id: //depot/perl@29611