summaryrefslogtreecommitdiff
path: root/universal.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unneeded use of INT2PTR() in the XS for Tie::Hash::NamedCapture.Nicholas Clark2010-08-311-8/+8
|
* create the "mauve" temporary namespace for things like reftypeYves Orton2010-08-301-0/+110
| | | | | | | | | | | | | | | | | | | | | | Scalar::Util::reftype(), refaddr() and blessed() are all a bit less useful than they could be as they all return C<undef> when their argument is not a reference. While this is logical, it also means that using these routines has to be guarded, and normally guarded in such a way that the internal logic is called twice. Additionally these routines are quite commonly used and having to load an additional DLL and XS code every program is inefficient. Therefore we introduce the "mauve" namespace for to hold the "fixed" equivalents, this namespace is /always/ loaded (like the 're' or 'utf8' namespaces), and thus these routines can be accessed easily at any time. We also provide a new module wrapper in t/lib which allows these routines to be exported into other namespaces if the user so chooses. At Jesse's request I have included weaken() and as it seemed logical to do so I have also added isweak(). Once we have a good name for the namespace we can s/mauve/whatever/g
* Stop leaking temporary version objects from XSgfx2010-06-281-6/+7
|
* Prevent object methods called as class methodsJohn Peacock2010-06-281-16/+16
| | | | | | | | | | There are a number of object methods which make absolutely no sense when called as class methods. In addition, with Perl 5.11.5/5.12.0, there are asserts which will trigger SEGV's when you do that. So we check in the XS code and refuse to continue if an object method is called as a class method.
* Add Perl_croak_no_modify() to implement Perl_croak("%s", PL_no_modify).Nicholas Clark2010-06-271-3/+3
| | | | | This reduces object code size, reducing CPU cache pressure on the non-exception paths.
* PATCH: teach diag.t new warning function namesKarl Williamson2010-06-011-1/+1
| | | | | | | | | | | | | | | | | A number of function names that do warnings have been added, but diag.t hasn't kept up. This patch changes it to look for likely function names in embed.fnc, so it will automatically keep up in the future. There's no need to worry about it looking for inappropriate functions, as the syntax of messages that it looks for is so restrictive, that there won't be false positives. Instead there are still many messages it fails to catch. As a result of it's falling behind several issues have crept in. I resolved the couple I thought were clear (including one in a comment; diag.t doesn't strip comments, but mostly it doesn't matter), and added the others to the <DATA> section to ignore. are
* Use sizeof instead of hard-coded array sizeKarl Williamson2010-05-291-1/+1
| | | | The array should be declared with its actual size.
* TypoKarl Williamson2010-05-291-1/+1
|
* InPerl_boot_core_UNIVERSAL() use a data structure for calls to newXS{,proto}Nicholas Clark2010-05-281-118/+81
| | | | | Replacing the longhand list of calls to newXS{,proto} with loop over a data structure reduces the object size by over 1K.
* Fix utf8::is_utf8 to respect GMAGIC (e.g. $1)gfx2010-04-251-1/+2
|
* initialize undefined version objects with zero, not 'undef'David Golden2010-01-211-2/+2
|
* Omnibus strict and lax version parsingDavid Golden2010-01-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Authors: John Peacock, David Golden and Zefram The goal of this mega-patch is to enforce strict rules for version numbers provided to 'package NAME VERSION' while formalizing the prior, lax rules used for version object creation. Parsing for use() is unchanged. version.pm adds two globals, $STRICT and $LAX, containing regular expressions that define the rules. There are two additional functions -- version::is_strict and version::is_lax -- that test an argument against these rules. However, parsing of strings that might contain version numbers is done in core via the Perl_scan_version function, which may be called during compilation or may be called later when version objects are created by Perl_new_version or Perl_upg_version. A new helper function, Perl_prescan_version, has been added to validate a string under either strict or lax rules. This is used in toke.c for 'package NAME VERSION' in strict mode and by Perl_scan_version in lax mode. It matches the behavior of the verison.pm regular expressions, but does not use them directly. A new test file, comp/packagev.t, validates strict and lax behaviors of 'package NAME VERSION' and 'version->new(VERSION)' respectively and verifies their behavior against the $STRICT and $LAX regular expressions, as well. Validating these two implementation should help ensure they each work as intended. Other files and tests have been modified as necessary to support these changes. There is remaining work to be done in a few areas: * documenting all changes in behavior and new functions * determining proper treatment of "," as decimal separators in various locales * updating diagnostics for new error messages * porting changes back to the version.pm distribution on CPAN, including pure-Perl versions
* Tie::Hash::NamedCapture::* shouldn't abort if passed bad input [RT #71828]Nicholas Clark2010-01-051-8/+8
|
* Add missing LEAVE to universal.c sv_doesGerard Goossen2009-11-121-2/+6
|
* Unused 'cv'Jerry D. Hedden2009-07-021-0/+1
|
* Integrate version.pm-0.77 into bleadperlJohn Peacock2009-06-281-9/+41
|
* Note why we need a seemingly useless empty &Regexp::DESTROYNicholas Clark2009-03-311-0/+1
|
* Change Regexp::DESTROY to be a constant subroutine, removing XS_Regexp_DESTROY.Nicholas Clark2009-03-291-8/+2
| | | | A constant subroutine is now optimised away at DESTROY time.
* Remove declaration of XS_Internals_inc_sub_generationRafael Garcia-Suarez2009-03-081-1/+0
| | | | | The function Internals::inc_sub_generation() was removed in commit 41892db1963e88b547da12808d8e5630cc1edb59
* Make PerlIO::get_layers really test flgok before reading *flgsvpVincent Pit2009-03-071-1/+1
|
* get_isa_hash() is only used in S_isa_lookup(), so it can be static. Also, it hasNicholas Clark2009-01-031-3/+3
| | | | | never been in a released version of perl, so this change has no compatibility implications.
* Following change 34356, which decoupled get_isa_hash() fromNicholas Clark2009-01-031-0/+35
| | | | S_mro_get_linear_isa_dfs(), we can move get_isa_hash() to any other source file.
* PATCH: Large omnibus patch to clean up the JRRT quotesTom Christiansen2008-11-021-3/+5
| | | | | | Message-ID: <25940.1225611819@chthon> Date: Sun, 02 Nov 2008 01:43:39 -0600 p4raw-id: //depot/perl@34698
* Explicitly specify some printf formats for constant strings.Rafael Garcia-Suarez2008-11-021-3/+3
| | | | | | This is mostly to silence gcc's warning, "format not a string literal and no format arguments". p4raw-id: //depot/perl@34694
* Add MUTABLE_GV(), and eliminate (V *) casts in *.c.Nicholas Clark2008-10-311-2/+2
| | | | | | Can't easily do gv.h, as GvGP() (at least) needs to split into two macros - one const for reading, one non-const for writing. p4raw-id: //depot/perl@34679
* Eliminate (SV *) casts from sv.c and [tu]*.c, except for the cast inNicholas Clark2008-10-301-13/+13
| | | | | Perl_sv_magicext(), which is documented. p4raw-id: //depot/perl@34671
* Use pvs macros instead of pvn where possible.Marcus Holland-Moritz2008-10-291-1/+1
| | | p4raw-id: //depot/perl@34653
* Eliminate (AV *) casts in *.c.Nicholas Clark2008-10-291-1/+1
| | | p4raw-id: //depot/perl@34650
* Eliminate (HV *) casts in u*.c.Nicholas Clark2008-10-281-4/+4
| | | p4raw-id: //depot/perl@34624
* Update copyright years.Nicholas Clark2008-10-251-1/+1
| | | p4raw-id: //depot/perl@34585
* Create a direct lookup hash for ->isa() lookup, by retaining theNicholas Clark2008-09-121-22/+19
| | | | | | | | | | | de-duping hash used by S_mro_get_linear_isa_dfs(). Provide a new function Perl_get_isa_hash() to lazily retrieve this. (Which could actually be static if S_isa_lookup() and Perl_sv_derived_from() moved into mro.c.) Make S_isa_lookup() use this lookup hash in place of a linear walk of the linear isa. This should turn isa lookups from O(n) to O(1), which should make heavy users of ->isa() faster. (eg PPI, and hence Perl Critic). p4raw-id: //depot/perl@34354
* Abolish the warning "Can't locate package %"SVf" for the parents of %s"Nicholas Clark2008-09-111-8/+0
| | | | | | | which doesn't tell you anything you won't discover soon enough when you try to call a method. (Or haven't already been warned about when @ISA was linearised) p4raw-id: //depot/perl@34353
* As stash can't be NULL, no need to check name_stash is not NULL beforeNicholas Clark2008-09-111-1/+1
| | | | | comparing the two, as a NULL == NULL comparison can't happen. p4raw-id: //depot/perl@34352
* Use 1 line of code in place of 6 in Perl_sv_derived_from().Nicholas Clark2008-09-111-6/+1
| | | p4raw-id: //depot/perl@34350
* S_isa_lookup() no longer recurses (as of Brandon's MRO changes), so weNicholas Clark2008-09-111-3/+3
| | | | | don't need to pass in name_stash as a parameter. p4raw-id: //depot/perl@34349
* No, I didn't mean to commit the version *with* the abort(). It wasNicholas Clark2008-08-221-1/+0
| | | | | | meant to be removed once I'd proved it by running the tests without aborting. Oops. use more 'coffee'; p4raw-id: //depot/perl@34217
* Note that we have no test coverage for this particular warning.Nicholas Clark2008-08-221-0/+2
| | | p4raw-id: //depot/perl@34216
* Welcome to refcount hell. Fix the leaks reported by #57024Marcus Holland-Moritz2008-07-181-13/+10
| | | | | along with a bunch other named capture related leaks. p4raw-id: //depot/perl@34151
* Silence build warnings in universal.cJerry D. Hedden2008-05-231-1/+2
| | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510805211015m5c59bbf5wf3a992e776b1c4c4@mail.gmail.com> p4raw-id: //depot/perl@33910
* Make the worst case error message for Perl_croak_xs_usage() consistentNicholas Clark2008-05-211-1/+1
| | | | | with stringifying a code reference. p4raw-id: //depot/perl@33902
* Add Perl_croak_xs_usage(), which reduces a lot of explicit calls ofNicholas Clark2008-05-211-70/+71
| | | | | | | the form Perl_croak(aTHX_ "Usage %s::%s(%s)", "ouch" "awk", "eee_yow"); down to croak_xs_usage(cv, "eee_yow"); and refactor all the core XS code to use it. This adds () to the error messages for attributes::* p4raw-id: //depot/perl@33901
* assert() that every NN argument is not NULL. Otherwise we have theNicholas Clark2008-02-121-1/+7
| | | | | | | | | | | | ability to create landmines that will explode under someone in the future when they upgrade their compiler to one with better optimisation. We've already done this at least twice. (Yes, some of the assertions are after code that would already have SEGVd because it already deferences a pointer, but they are put in to make it easier to automate checking that each and every case is covered.) Add a tool, checkARGS_ASSERT.pl, to check that every case is covered. p4raw-id: //depot/perl@33291
* In XS_PerlIO_get_layers() take advantage of the implementation ofNicholas Clark2008-02-021-8/+13
| | | | | | PerlIO_get_layers(), by co-opting the new SVs it creates, rather than copying them. p4raw-id: //depot/perl@33182
* In XS_re_regexp_pattern(), use newSVpvn_flags() to avoid calls toNicholas Clark2008-02-021-7/+5
| | | | | sv_2mortal(). p4raw-id: //depot/perl@33181
* toke.c/universal.c: constingSteven Schubiger2008-01-291-2/+2
| | | | | Message-ID: <20080128125741.GA27390@refcnt.homeunix.org> p4raw-id: //depot/perl@33103
* Move re::regexp_pattern to universal.cJerry D. Hedden2008-01-091-0/+95
| | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510801081201q5c36f055re6165ebfe8876c2e@mail.gmail.com> p4raw-id: //depot/perl@32911
* Post change 32880, restore the dummy sub Regexp::DESTROY {}Nicholas Clark2008-01-071-0/+8
| | | p4raw-id: //depot/perl@32896
* Add macros mPUSHs() and mXPUSHs() for pushing SVs on the stackMarcus Holland-Moritz2008-01-041-10/+10
| | | | | | and mortalizing them. Use these macros where possible. And also mX?PUSH[inpu] where possible. p4raw-id: //depot/perl@32821
* Add newSVpvs_flags() as a wrapper to newSVpvn_flags(), and reworkNicholas Clark2008-01-031-2/+2
| | | | | sv_2mortal(newSVpvs(...)) constructions to use it. p4raw-id: //depot/perl@32819
* Forgot to remove dTARGET with change #32816.Marcus Holland-Moritz2008-01-031-1/+0
| | | | | p4raw-link: @32816 on //depot/perl: 1eb9e81d303aab0f6c2386f44bc76241948fce0f p4raw-id: //depot/perl@32817