summaryrefslogtreecommitdiff
path: root/util.c
Commit message (Collapse)AuthorAgeFilesLines
* Deal with "\c{", and its kinKarl Williamson2010-04-261-0/+33
| | | | | | | | | | | | | | | | | | make regen is needed This patch forbids non-ascii following the "\c". It also terminates for "\c{" with a message to contact p5p if there is need for continuing its current definition. And if the character following the "\c" causes the result to not be a control character, a warning is issued. This is currently 'deprecated', which by default is turned on. This can easily be changed later. This patch is the initial patch. It does not do any fancy showing the context where the problematic construct occurs. This can be added later. It gathers the 3 occurrences of evaluating \c and puts them in one common routine.
* Add perlintern.pod documentation docatch + prescan_versionReini Urban2010-03-081-0/+5
| | | | docatch - perl run-time exception handling
* Fix SV leaks in Perl_vnumify() and Perl_vnormal() for "Invalid version object"sNicholas Clark2010-01-151-10/+7
|
* Omnibus strict and lax version parsingDavid Golden2010-01-131-52/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Correct some #ifdef USE_ITHREADS / USE_MULTIMax Maischein2009-12-171-0/+8
|
* Add mingw64 supportSisyphus2009-11-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hi, Using the attached patch to the blead source (as of a few hours ago), I can build perl with the following OS/compiler/make combos. On 32-bit XP: MSVC++ 7.0 / dmake (uses win32/makefile.mk) MSVC++ 7.0 / nmake (uses win32/Makefile) Borland C++ 5.5.1 / dmake mingw.org's gcc-4.3.0 / dmake mingw.org's gcc-3.4.5 / dmake mingw-w64.sf's 32-bit gcc-4.4.3 / dmake (There's a bug with that last compiler on XP. The perl it builds on XP hangs on XP, but runs ok if copied across to Vista. I think this is unrelated to the patches - probably even unrelated to perl. Without these patches perl will not even build using that last compiler.) On 64-bit Vista: 32-bit MSVC++ 7.0 / nmake (uses win32/Makefile) 32-bit MSVC++ 7.0 / dmake (uses win32/makfile.mk) 32-bit Borland C++ 5.5.1 / dmake mingw.org's 32-bit gcc-4.4.0 / dmake mingw.org's 32-bit gcc-3.4.5 / dmake mingw-w64.sf's 32-bit gcc-4.4.3 / dmake mingw-w64.sf's 64-bit gcc-4.4.3 / dmake mingw-w64.sf's 64-bit x86_64-w64-mingw32-gcc-4.4.3 / dmake 64-bit MicrosoftPlatform SDK for Windows Server 2003 R2 / dmake (uses win32/makefile.mk) 64-bit MicrosoftPlatform SDK for Windows Server 2003 R2 / nmake (uses win32/Makefile) Not all of those builds pass all tests - but where the removal of the patches still permits perl to build, the same tests still fail. That is, *nothing* is lost by including these patches - but there are significant gains. Each of the above builds was done according to the normal win32 configuration parameters - ie multi-threaded, non debug. No unusual config settings were applied. (I did build one debug perl on Vista using mingw-w64.sf's 32-bit gcc-4.4.3 and it built fine.) Please feel free to apply these patches (with or without modification) - and, yes, you're more than welcome to blame me if they cause any breakages ;-) Of course, some of those compilers (Borland, Microsoft, and the compilers from mingw.org) already build perl *without* having to apply any patches. It's just the other compilers that need the patches. The purpose of testing with Borland, Microsoft, and the mingw.org compilers is just to check that these patches don't break them. As a final check, I've done a build on my aging linux (mandrake-9.1) box, gcc-3.2.2. I built with '-des -Duselongdouble -Duse64bitint -Dusedevel'. No problem with that, either. If there's additional testing requirements please let me know, and I'll try to oblige. I believe the patch applied successfully for me - see below my sig for the output. Cheers, Rob Rob@desktop2 ~/GIT/blead $ patch -p0 <blead_diff.diff patching file dist/threads/threads.xs patching file handy.h patching file cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win32.pm patching file op.c Hunk #1 succeeded at 5774 (offset 47 lines). patching file pp_pack.c patching file util.c Hunk #1 succeeded at 5366 (offset -28 lines). patching file win32/makefile.mk patching file win32/perlhost.h patching file win32/win32.c patching file win32/win32.h patching file README.win32 patching file XSUB.h
* move JMPENV_JUMP to die_where and mark it as "noreturn"Gerard Goossen2009-11-061-15/+3
|
* Use of SV* instead of message, msglen, utf8 to contain error messageGerard Goossen2009-11-011-40/+25
|
* Remove unused variableRafael Garcia-Suarez2009-10-291-1/+0
|
* remove unnecessary (always true) condition in S_vdieGerard Goossen2009-10-291-3/+3
|
* Let SvRX(OK) recognise a bare REGEXP.Ben Morrow2009-10-221-7/+4
| | | | This means that re::is_regexp(${qr/x/}) will now return true.
* Change S_ckwarn_common() to looping over the packed warning value.Nicholas Clark2009-10-131-7/+18
| | | | | | The core never uses WARN3() or WARN4(), and rarely uses WARN2(), so the previous code, effectively an unwrapped loop, wasn't a speed up. Functionally equivalent smaller code fits better into CPU caches.
* Migrate common code in Perl_ckwarn() and Perl_ckwarn_d() to S_ckwarn_common()Nicholas Clark2009-10-131-15/+9
|
* In Perl_ckwarn() and Perl_ckwarn_d() disentangle the complex conditionals.Nicholas Clark2009-10-131-30/+36
| | | | It's much easier to see what is going on, if we use multiple return statements.
* Add Perl_ck_warner_d(), which combines Perl_ckwarn_d() and Perl_warner().Nicholas Clark2009-10-121-0/+13
| | | | | 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-14/+22
| | | | | | | 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.
* In Perl_ckwarn(), simplify the check of isLEXWARN_on/isLEXWARN_off.Nicholas Clark2009-10-121-11/+5
|
* Speed up repeatcpy() by at least 40% for 1-char or numerous repeatsVincent Pit2009-08-271-15/+25
| | | | | | | | | | | | And don't make it receive the interpreter anymore. For 1-char repeats, use memset(). Otherwise, use the old implementation up to some (small) length, and then use memcpy() in a binary manner, based on what we previously copied. Note that we use memcpy() so both strings shouldn't overlap. The previous implementation didn't allow this as well. This would be a good place to use the restrict keyword from C99. I'm not sure if Configure has a probe for it.
* delimcopy(), ibcmp(), ibcmp_locale(), instr(), ninstr() and rninstr() from ↵Vincent Pit2009-08-271-12/+6
| | | | util.c don't need the interpreter as well
* Perl_die_nocontext() is also called with NULL from XS extensions that want ↵Vincent Pit2009-08-131-1/+0
| | | | | | to set $@ themselves. This commit goes with 52a5bfab8876f302d269f1bfa46eae1998f0d3ca.
* Remove the port to MiNT. It's a dead platform that hasn't had any love ↵Jesse Vincent2009-08-031-1/+1
| | | | since 5.005
* Integrate version.pm-0.77 into bleadperlJohn Peacock2009-06-281-1/+9
|
* A few docs nits after the few last commitsRafael Garcia-Suarez2009-06-211-2/+2
|
* simplify PERL_MEM_LOGJim Cromie2009-06-211-38/+24
| | | | | | | | | | | | | | | | | | This combines multiple environment variable reads into 1, where it looks for values like "2mst" -2 leading digits are atoi()d to get FD -m memory logging please -s sv logging also -t timestamp those please. Combining these reduces overhead such that it seemed worthwhile to drop all the ifdefs. TBD whether this works in the environment that drove the original tradeoffs. If it isnt enough, Id be tempted by a global static ptr, and on 1st use, is read, seen 0, a lock is taken, and getenvar run to populate it, unlocked, proceed. This would remove iterative overheads.
* invert and rename PERL_MEM_LOG_STDERR to PERL_MEM_LOG_NOIMPLJim Cromie2009-06-211-37/+67
| | | | | | | Most users who want PERL_MEM_LOG want the default implementation, give it to them. Users providing their own implementation can obtain current behavior by adding -DPERL_MEM_LOG_NOIMPL. Frankly, the average user probably wants _ENV by default too.
* Remove all the 5005threads specific mutex macros, which are now vestigial.Nicholas Clark2009-05-211-6/+0
|
* Remove all #ifdef MACOS_TRADITIONAL code in core and non-dual-life XS code.Nicholas Clark2009-04-271-26/+5
| | | | | | | | (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.)
* Make util.c compile on systems without getcwd()Rafael Garcia-Suarez2009-03-021-2/+3
|
* Rename ext/Time/HiRes to ext/Time-HiResNicholas Clark2009-02-091-1/+1
|
* Update the documentation of get_sv() to note that it calls Perl_gv_fetchpv(),Nicholas Clark2009-01-211-1/+1
| | | | | and hence the 'create' argument is actually 'flags'. Fix core code and documentation that used TRUE or FALSE to use 0 or GV_ADD.
* about warnings if forks fail in Perl_my_popenSlaven Rezic2009-01-191-1/+5
|
* Re: [PATCH] standardize save/restore of errno & vaxc$errnoChip Salzenberg2008-12-091-2/+2
| | | | | Message-ID: <20081205213219.GH16081@tytlal.topaz.cx> p4raw-id: //depot/perl@35059
* standardize save/restore of errno & vaxc$errnoChip Salzenberg2008-12-051-17/+10
| | | | | Message-ID: <20081127070141.GD17663@tytlal.topaz.cx> p4raw-id: //depot/perl@35018
* Eliminate setenv_getix()Jerry D. Hedden2008-12-011-25/+8
| | | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510812010947p7df19438kc19c279bcffe4b83@mail.gmail.com> Date: Mon, 1 Dec 2008 12:47:35 -0500 p4raw-id: //depot/perl@34971
* setenv_getix() is not used anywhere other than util.c (and the "specialNicholas Clark2008-11-261-2/+2
| | | | | | biologist word for stable" Msql-Mysql-modules-1.2219) so make it static. p4raw-id: //depot/perl@34940
* Just s/Perl_/S_/ isn't good enough - you also need to add the C<static>Nicholas Clark2008-11-261-1/+1
| | | p4raw-id: //depot/perl@34934
* pidgone() is only used in util.c, so it can be static.Nicholas Clark2008-11-261-1/+1
| | | p4raw-id: //depot/perl@34932
* vdie() isn't used anywhere aside from util.c, so it can be static.Nicholas Clark2008-11-261-1/+1
| | | p4raw-id: //depot/perl@34923
* PATCH: Large omnibus patch to clean up the JRRT quotesTom Christiansen2008-11-021-2/+4
| | | | | | 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-2/+2
| | | | | | 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-1/+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-7/+7
| | | | | Perl_sv_magicext(), which is documented. p4raw-id: //depot/perl@34671
* Use pvs macros instead of pvn where possible.Marcus Holland-Moritz2008-10-291-3/+3
| | | p4raw-id: //depot/perl@34653
* Eliminate (AV *) casts in *.c.Nicholas Clark2008-10-291-6/+6
| | | p4raw-id: //depot/perl@34650
* Eliminate (HV *) casts in u*.c.Nicholas Clark2008-10-281-35/+35
| | | p4raw-id: //depot/perl@34624
* Update copyright years.Nicholas Clark2008-10-251-2/+2
| | | p4raw-id: //depot/perl@34585
* Make C++ compilers happy #1: "typename" is a C++ keyword.Marcus Holland-Moritz2008-10-241-7/+7
| | | p4raw-id: //depot/perl@34574
* Add PERL_ARGS_ASSERT_MEM_LOG_COMMON to S_mem_log_common().Marcus Holland-Moritz2008-10-241-0/+3
| | | p4raw-id: //depot/perl@34570
* Add SV allocation tracing to -Dm and PERL_MEM_LOGMarcus Holland-Moritz2008-10-241-8/+42
| | | | | Message-ID: <20081022013731.23b5a2e5@r2d2> p4raw-id: //depot/perl@34568
* Refactor Perl_mem_log_ functionsMarcus Holland-Moritz2008-10-241-97/+66
| | | | | Message-ID: <20081022013721.374a490c@r2d2> p4raw-id: //depot/perl@34567