summaryrefslogtreecommitdiff
path: root/perl.h
Commit message (Collapse)AuthorAgeFilesLines
* plugin mechanism to rewrite calls to a subroutineZefram2010-10-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | New magic type PERL_MAGIC_checkcall attaches a function to a CV, which will be called as the second half of the op checker for an entersub op calling that CV. Default state, in the absence of this magic, is to process the CV's prototype if it has one, or apply list context to all the arguments if not. New API functions cv_get_call_checker() and cv_set_call_checker() provide a clean interface to this facility, hiding the internal use of magic. Expose in the API the new functions rv2cv_op_cv(), ck_entersub_args_list(), ck_entersub_args_proto(), and ck_entersub_args_proto_or_list(), which are meaningful segments of standard entersub op checking and are likely to be useful in plugged-in call checker functions. Expose new API function op_contextualize(), which is a public interface to the internal scalar()/list()/scalarvoid() functions. This API is likely to be required in most plugged-in call checker functions. Incidentally add new function mg_free_type(), in the API, which will remove magic of one type from an SV. (mg_free() removes all magic, and there isn't anything else more selective.)
* Add VMS symbol shortening to PL_bincompat_options.Craig A. Berry2010-10-091-0/+3
|
* Remove MEMBER_TO_FPTR.Ben Morrow2010-10-061-58/+55
| | | | This is left over from PERL_OBJECT (see beeff2, 16c915, and so on).
* fix indentation of MY_CXT #definesDavid Mitchell2010-09-011-35/+35
| | | | Only whitespace changes
* merge two similar MY_CXT code branchesDavid Mitchell2010-09-011-37/+7
| | | | No functional changes
* MY_CXT macros: make the two sets of defs similarDavid Mitchell2010-09-011-8/+12
| | | | | | | Three years ago there was a cut and paste of all the MY_CXT macros into a second #ifdef PERL_GLOBAL_STRUCT_PRIVATE branch with minor modifications (Bad programmer! No cookie!). Make the two branches more similar in preparation for a partial merge. No functional changes.
* Remove CALL_FPTR and CPERLscope.Ben Morrow2010-08-201-40/+47
| | | | | | | | | | | | | | | | These are left from PERL_OBJECT, which was an implementation of multiplicity using C++ objects. PERL_OBJECT was removed in 5.8, but the macros seem to have been cargo-culted all over the core (including in places where they would have been inappropriate originally). Since they now do exactly nothing, it's cleaner to remove them. I have left the definitions in perl.h, under #ifndef PERL_CORE, since some CPAN XS code uses them (also often incorrectly). I have also left STATIC alone, since it seems potentially more useful and is much more ingrained. The only appearance of these macros this patch doesn't touch is in Devel-PPPort, because that's a CPAN module.
* Revert "Make the peep recurse via PL_peepp"Florian Ragwitz2010-08-161-7/+1
| | | | | | | | | | | | | This reverts commit 65bfe90c4b4ea5706a50067179e60d4e8de6807a. While it made a few of the things I wanted possible, a couple of other things one might need to do and I thought this change would enable don't actually work. Thanks Zefram for pointing out my mistake. Conflicts: ext/XS-APItest/APItest.xs op.c
* make string-append on win32 100 times fasterWolfram Humann2010-08-131-0/+8
| | | | | | | | | | | | | | | | When a string grows (e.g. gets appended to), perl calls sv_grow. When sv_grow decides that the memory currently allocated to the string is insufficient, it calls saferealloc. Depending on whether or not perl was compiled with 'usemymalloc' this calls realloc in either perls internal version or on the operating system. Perl requests from realloc just the amount of memory required for the current operation. With 'usemymalloc' this is not a problem because it rounds up memory allocation to a certain geometric progression anyway. When the operating system's realloc is called, this may or may not lead to desaster, depending on how it's implemented. On win32 it does lead to desaster: when I loop 1000 times and each time append 1000 chars to an initial string size of 10 million, the memory grows from 10.000e6 to 10.001e6 to 10.002e6 and so on 1000 times till it ends at 11.000e6.
* Check API compatibility when loading xs modulesFlorian Ragwitz2010-07-261-0/+4
| | | | | | | | | | | | | This adds PL_apiversion, allowing the API version of a running interpreter to be introspected. It is used in the new XS_APIVERSION_BOOTCHECK macro, which is added to the _boot function of every XS module, to compare it against the API version the module has been compiled against. If the versions do not match, an exception is thrown. This doesn't fully prevent binary incompatible extensions to be loaded. It merely compares PERL_API_* between compile- and runtime, and does not attempt to solve the problem of identifying binary incompatible perls with the same API version (i.e. the same perl version configured with and without DEBUGGING).
* Make the peep recurse via PL_peeppFlorian Ragwitz2010-07-251-1/+7
| | | | | | | | | | | Also allows extensions, when delegating to Perl_peep, to specify what function it should use when recursing into a part of the op tree. The usecase for this are extensions like namespace::alias, which need to hook into the peep to do their thing. With this change they can stop copying the whole peep only to add tiny bits of new behaviour to it, allowing them to work easier on a large variety of perls, without having to maintain one peep which works on all of them (which is HARD!).
* Add a Configure probe for static inline.Andy Dougherty2010-07-221-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | This patch enables Configure to probe for C99-style 'static inline'. (That is, functions may be inlined, but will not be externally visible.) The initial idea is that some common code in messy macros inside headers might be simplified using inline functions. If the compiler does not support 'static inline', then a plain 'static' is used instead, along with the consequent implications of a function call (though the compiler may optimize away the function call and inline the function anyway). In either case, you simply use PERL_STATIC_INLINE. This patch does not *use* this facility at all yet. It is merely a Configure patch to make the facility availble for others to experiment with. VMS and Windows files will still need to be manually updated. Finally, before actually converting anything to inline functions, please try to carefully evaluate the performance implications of any proposed changes. Compilers vary in what they will and will not convert to inline functions, so it's worth proceeding slowly and carefully. This patch results from a single new metaconfig unit, d_static_inline.U, which I will separately upload to the metaconfig repository.
* Macroify the block_hooks structure.Ben Morrow2010-07-121-0/+2
| | | | | Add a flags member, so it can be extended later if necessary. Add a bhk_eval member, called from doeval to catch requires and string evals.
* add my_[l]stat_flags(); make my_[l]stat() mathomsDavid Mitchell2010-07-031-0/+4
| | | | | | | my_stat() and my_lstat() call get magic on the stack arg, so create _flags() variants that allow us to control this. (I can't just change the signature or the mg_get() behaviour since my_[l]stat() are listed as being in the public API, even though they're undocumented.)
* Stop using WITH_THR and WITH_THX, as they were never necessary here.Nicholas Clark2010-06-161-2/+2
|
* add handy note on vtable fieldsDavid Mitchell2010-06-051-0/+13
|
* add PL_signalhook to hook into signal dispatchDavid Mitchell2010-06-041-1/+2
| | | | | This is initially intended for threads::shared and shouldn't (yet) be considered part of the public API.
* On the save stack, store the save type as the bottom 6 bits of a UV.Nicholas Clark2010-05-011-0/+1
| | | | This makes the other 26 (or 58) bits available for save data.
* remove Perl_pmflagRobin Barker2010-04-261-8/+0
|
* Don't allocate pointer table entries from arenas.Nicholas Clark2010-04-251-3/+3
| | | | | Instead, allocate a private arena chain per pointer table, and free that chain when its pointer table is freed. Patch from RT #72598.
* improve -Dl debugging outputDavid Mitchell2010-03-301-2/+4
| | | | | In particular, distinguish between scope and context stack push/pops, show depth of JUMPENV stack, and show STACKINFO push/pops
* Introduce C<use feature "unicode_strings">Rafael Garcia-Suarez2009-12-201-1/+1
| | | | | | | | | | | | | This turns on the unicode semantics for uc/lc/ucfirst/lcfirst operations on strings without the UTF8 bit set but with ASCII characters higher than 127. This replaces the "legacy" pragma experiment. Note that currently this feature sets both a bit in $^H and a (unused) key in %^H. The bit in $^H could be replaced by a flag on the uc/lc/etc op. It's probably not feasible to test a key in %^H in pp_uc in friends each time we want to know which semantics to apply.
* Handle $@ being assigned a read-only value (without error or busting the stack).Nicholas Clark2009-11-291-2/+18
| | | | Discovered whilst investigating RT #70862.
* Fix RT #70862 by converting ERRSV to GvSVn() to ensure a non-NULL GvSV().Nicholas Clark2009-11-291-1/+1
|
* Make unicode semantics the defaultKarl Williamson2009-11-231-1/+1
|
* Inline PL_no_symref_sv into its users. Deprecate the visible global variable.Nicholas Clark2009-11-151-2/+4
| | | | | | | | | As the core no longer needs this fixed string outside of pp.c, it seems daft to make it public just in case any module wants to use it. Modules that do should provide their own inline copy in future. Also restore the visible global PL_no_symref_sv back to the original format specificiation (of 5.10.0 and earlier).
* Inline PL_no_symref into pp_entersub. Deprecate the visible global variable.Nicholas Clark2009-11-151-2/+2
| | | | | | | | | | | As the core no longer needs this fixed string in more than one place, it seems daft to go to the overhead (and cost) of making it public in case any module wants to use it. Modules that do want to use it should provide their own inline copy in future. Also restore the visible global PL_no_symref back to the original format specification (of 5.10.0 and earlier), as an extra %s has the potential to cause SEGVs or worse if not spotted at compile time.
* add code for Unicode semantics for non-utf8 latin1 charsKarl Williamson2009-11-141-21/+97
|
* Merge branch 'legacy-pragma' into bleadRafael Garcia-Suarez2009-11-061-0/+1
|\ | | | | | | | | Conflicts: MANIFEST
| * Deliver skeleton legacy.pmKarl2009-01-231-0/+1
| |
* | Implement facility to plug in syntax triggered by keywordsJesse Vincent2009-11-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Date: Tue, 27 Oct 2009 01:29:40 +0000 From: Zefram <zefram@fysh.org> To: perl5-porters@perl.org Subject: bareword sub lookups Attached is a patch that changes how the tokeniser looks up subroutines, when they're referenced by a bareword, for prototype and const-sub purposes. Formerly, it has looked up bareword subs directly in the package, which is contrary to the way the generated op tree looks up the sub, via an rv2cv op. The patch makes the tokeniser generate the rv2cv op earlier, and dig around in that. The motivation for this is to allow modules to hook the rv2cv op creation, to affect the name->subroutine lookup process. Currently, such hooking affects op execution as intended, but everything goes wrong with a bareword ref where the tokeniser looks at some unrelated CV, or a blank space, in the package. With the patch in place, an rv2cv hook correctly affects the tokeniser and therefore the prototype-based aspects of parsing. The patch also changes ck_subr (which applies the argument context and checking parts of prototype behaviour) to handle subs referenced by an RV const op inside the rv2cv, where formerly it would only handle a gv op inside the rv2cv. This is to support the most likely kind of modified rv2cv op. [This commit includes the Makefile.PL for XS-APITest-KeywordRPN missing from the original patch, as well as updates to perldiag.pod and a MANIFEST sort]
* | Remove Perl_pmflag() from the public API, and mark it as deprecated.Nicholas Clark2009-11-011-0/+8
| | | | | | | | | | | | regcomp.c stopped using it before 5.10, leaving only toke.c. The only code on CPAN that uses it is copies of regcomp.c. Replace it with a static function, with a cleaner interface.
* | add an elipses to string/ref warnings when str longer than 32 charsYves Orton2009-10-261-2/+2
| | | | | | | | | | | | Wasted a few minutes more than necessary trying to work out why the string was truncated when in fact it was the error message that was truncating the string.
* | New debugging flag -DB now dumps subroutine definitions,Chip Salzenberg2009-08-261-2/+8
| | | | | | | | leaving -Dx for its original purpose of dumping syntax trees.
* | Eliminate *_ALLOCATED_HEAD and *_HEAD macros which are now used only once.Nicholas Clark2009-08-221-1/+0
| |
* | Add clear magic to %^H so that the HE chain is reset when you empty it.Zefram2009-08-211-2/+14
| | | | | | | | This fixes [perl #68590] : %^H not lexical enough.
* | add -DM flag to track smartmatch resolutionDavid Mitchell2009-08-201-1/+7
| |
* | The op_free() hook doesn't need to return an OP*, so introduce a new typedef ↵Vincent Pit2009-07-151-0/+1
| | | | | | | | for OP hooks
* | Added missing 2009 to perl.h copyright headerOffer Kaye2009-07-061-1/+1
| |
* | Add test to make sure everything that outputs an exception or warning has a ↵James Mastros2009-06-271-0/+1
| | | | | | | | matching entry in perldiag (and fix it so that more of the existing ones do).
* | Remove binary compatibility scaffolding for the change to PL_bitcount.Nicholas Clark2009-05-201-15/+0
| |
* | Replace run-time on-demand initialisation of PL_bitcount with a constant table.Nicholas Clark2009-05-201-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (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.
* | Fix -p function and Fcntl::S_IFIFO constant under Microsoft VC compilerJan Dubois2009-04-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create S_IFIFO macro as an alias for _S_IFIFO if only the latter is being defined by the standard headers (e.g. Microsoft Visual C++). This is necessary to get the C<-p> function working, and also to define the Fcntl::S_IFIFO constant. See also http://bugs.activestate.com/show_bug.cgi?id=82665 Cheers, -Jan From 6386a37b103723e3c473119b95dd0b8edc59a1ed Mon Sep 17 00:00:00 2001 From: Jan Dubois <jand@activestate.com> Date: Mon, 27 Apr 2009 15:44:23 -0700 Subject: [PATCH] Create S_IFIFO macro as an alias for _S_IFIFO if only the latter is being defined by the standard headers (e.g. Microsoft Visual C++). This is necessary to get the C<-p> function working, and also to define the Fcntl::S_IFIFO constant. See also http://bugs.activestate.com/show_bug.cgi?id=82665 Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
* | Remove all #ifdef MACOS_TRADITIONAL code in core and non-dual-life XS code.Nicholas Clark2009-04-271-10/+3
| | | | | | | | | | | | | | | | (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.)
* | document PERL_SYS_INIT, PERL_SYS_TERM and that they should only be used onceDavid Mitchell2009-04-021-0/+19
| |
* | Move PERL_VERSION_STRING from patchlevel.h to perl.hNicholas Clark2009-02-161-0/+4
| | | | | | | | | | | | (and revert a89d24b9fe54d44395806c16ac1c19f3c678cbbb) It's getting too complex to work around some versions of awk which don't want to implement the regular expressions that they are documented to implement.
* | PERL_FS_VER_FMT is only used with the current perl version, which is known atNicholas Clark2009-02-161-2/+10
| | | | | | | | compile time, so replace it with PERL_FS_VERSION, a compile time constant.
* | suidperl goes.Nicholas Clark2009-01-231-76/+0
| |
* | Ensure that C++ modules can be built against a perl configured with ↵Marcus Holland-Moritz2009-01-231-14/+14
|/ | | | | | | | | | -DPERL_GLOBAL_STRUCT_PRIVATE. Perl_GetVarsPrivate() could not be seen from within a module built with a C++ compiler if the perl binary was built with a C compiler, as the prototype was not 'extern "C"' for C++. The change moves the EXTERN_C defines so they can be used for the prototype of Perl_GetVarsPrivate().
* VMS posix exit fixesJohn Malmberg2009-01-041-27/+28
| | | | | | | | | | | | | | | | | | | | | | | perl.h and perl.c need further fixes to get VMS to return the expected POSIX exit codes when that is enabled. This fix gets the correct numbers except for the SIGTERM case, which will need some more work. It also gets the posix exit code to set an error severity on a fatal exit so that DCL and MMS/MMK or VMS native programs can easily detect a script failure. This patch does not address an issue in vms.c where the feature logicals may not be correctly read. That will follow in a future patch. The tests have been adjusted to detect when VMS is in the POSIX exit mode and perform properly. -John wb8tyw@gmail.com -- My qsl.net e-mail address is temporarily out of order.