summaryrefslogtreecommitdiff
path: root/intrpvar.h
Commit message (Collapse)AuthorAgeFilesLines
* stop do_clean_named_objs() leaving dangling refsDavid Mitchell2010-09-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently perl does 3 major scans of the SV arenas, so the action of perl_destroy() is a bit like this: for (all arena SVs) { if (its a ref to an object) undef the ref (and thus probably free the object) } for (all arena SVs) { if (it's a typeglob and at least one of its slots holds an object) { set SVf_BREAK on the gv SvREFCNT_dec(gv) } } return if $PERL_DESTRUCT_LEVEL < 1; PL_in_clean_all = 1 for (all arena SVs) { set SVf_BREAK on the sv SvREFCNT_dec(sv) } The second scan is problematic, in that by randomly zapping GVs, it can leave dangling pointers to freed GVs. This is while perl-level destructors may still be called, meaning perl users can see corrupted state. Note also that at this point PL_in_clean_all hasn't been set, so sv_free() may put out 'Attempt to free unreferenced scalar' warnings. This commit fixes this by only freeing the affected slots of the GV, rather than freeing the GV itself. Thus makes it more like the first pass, which undefs RVs, and ensures no dangling refs.
* documentation on hooking the peephole optimiserZefram2010-09-101-2/+44
| | | | | Signed-off-by: Florian Ragwitz <rafl@debian.org> [rafl@debian.org: Changed tabs to spaces in perlguts chunks for consistency]
* Reorder interpreter struct to remove alignment hole created by 9a87bd09eea1d037Nicholas Clark2010-09-081-5/+1
| | | | | | | nice_chunk_size was U32, and had been paired with another 32 bit value to ensure that all 64 bit quantities were naturally 64 bit aligned. There already was a 32 bit "hole" elsewhere - reorder the two unpaired 32 bit values next to each other.
* Remove offer_nice_chunk(), PL_nice_chunk and PL_nice_chunk_size.Nicholas Clark2010-09-081-2/+1
| | | | | | | | | | | | | | | | | | These provided a non-public API for the hash and array code to donate free memory direct to the SV head allocation routines, instead of returning it to the malloc system with free(). I assume that on some older mallocs this could offer significant benefits. However, my benchmarking on a modern malloc couldn't detect any significant effect (positive or negative) on removing the code. Its (continued) presence, however, has downsides a: slightly more code complexity b: slightly larger interpreter structure c: in the steady state, if net creation of SVs is zero, 1 chunk of allocated but unused memory will exist (per thread) So I think it best to remove it.
* make recursive part of peephole optimiser hookableZefram2010-08-261-1/+3
| | | | | | | | New variable PL_rpeepp makes it possible for extensions to hook the per-op-chain part of the peephole optimiser (which recurses into side chains). The existing variable PL_peepp still allows hooking the per-sub part of the peephole optimiser, maintaining perfect backward compatibility.
* Check API compatibility when loading xs modulesFlorian Ragwitz2010-07-261-0/+1
| | | | | | | | | | | | | 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).
* Generic hooks into Perl_block_{start,end}.Ben Morrow2010-07-121-0/+3
| | | | | | | | | | These take the form of a vtable pushed onto the new PL_blockhooks array. This could probably do with a API around it later. Separate pre_end and post_end hooks are needed to capture globals before the stack is unwound (like needblockscope in the existing code). The intention is that once a vtable is installed it never gets removed, so where necessary extensions using this will need to use a hinthv element to determine whether to do anything or not.
* identify a few vars in intrpvar.hDavid Mitchell2010-06-071-12/+12
|
* add PL_signalhook to hook into signal dispatchDavid Mitchell2010-06-041-0/+2
| | | | | This is initially intended for threads::shared and shouldn't (yet) be considered part of the public API.
* PL_in_load_module only has values 0 and 1, so can be a bool instead of int.Nicholas Clark2010-05-211-2/+2
|
* unwinding target nominated by separate globalZefram2010-04-251-0/+1
| | | | | | | | When unwinding due to die, the new global PL_restartjmpenv points to the JMP_ENV at which longjmping should stop and control should be transferred to PL_restartop. This replaces the previous use of cxstack[cxstack_ix+1].blk_eval.cur_top_env, located in a nominally-discarded context frame.
* qr/\X/ expansionKarl Williamson2009-12-051-0/+10
|
* PL_scopestack_name needs to be present, -DDEBUGGING or not.Nicholas Clark2009-11-181-3/+3
| | | | | | -DDEBUGGING and not need to be binary compatible with each other. Fixes the test failures in ext/re caused by d343c3ef45381352 for threaded builds without -DDEBUGGING.
* Add ENTER_with_name and LEAVE_with_name to automaticly check for matching ↵Gerard Goossen2009-11-121-0/+3
| | | | ENTER/LEAVE when debugging is enabled
* somewhat fix failing regex tests. but break lots of other stuff at the same timeYves Orton2009-10-191-0/+3
|
* Remove obsolete interpreter variable PL_utf8_alnumcRafael Garcia-Suarez2009-09-131-1/+0
|
* Document PL_opfreehookVincent Pit2009-07-151-0/+12
|
* The op_free() hook doesn't need to return an OP*, so introduce a new typedef ↵Vincent Pit2009-07-151-1/+1
| | | | for OP hooks
* Add a pluggable hook in op_free()Vincent Pit2009-07-081-0/+2
|
* Use only one block of memory for both PL_psig_name and PL_psig_ptr.Nicholas Clark2009-05-211-1/+2
|
* Remove binary compatibility scaffolding for the change to PL_bitcount.Nicholas Clark2009-05-201-10/+0
|
* Replace run-time on-demand initialisation of PL_bitcount with a constant table.Nicholas Clark2009-05-201-0/+8
| | | | | | | | | | | | | | | | (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.
* Document the purpose of PL_psig_ptr and PL_psig_name.Nicholas Clark2009-05-191-1/+5
|
* Add Perl_mro_register() to register Method Resolution Orders,Nicholas Clark2008-12-271-0/+6
| | | | | | Perl_mro_get_from_name() to retrieve MROs by name, and PL_registered_mros to store them in. Abolish the static array of mros, and instead register the dfs and c3 MRO structures.
* The vestigial PL_pad_reset_pending can actually be bool, rather thanNicholas Clark2008-11-261-5/+4
| | | | | | I32. This permits some space saving rejigging of the interpreter struct. p4raw-id: //depot/perl@34930
* Note where there is a U8 of space.Nicholas Clark2008-11-181-0/+2
| | | p4raw-id: //depot/perl@34887
* Rename PL_breakable_sub_generation to PL_breakable_sub_gen, to pleaseNicholas Clark2008-11-181-1/+2
| | | | | the ANSI gods of VMS. p4raw-id: //depot/perl@34886
* Fix the bug introduced with MRO, whereby the internals were not savingNicholas Clark2008-11-171-0/+2
| | | | | lines in subroutines defined inside eval ""s for the debugger. p4raw-id: //depot/perl@34873
* [perl #948] [PATCH] Allow tied $,Chip Salzenberg2008-11-141-3/+3
| | | | | Message-ID: <20081114084436.GJ5779@tytlal.topaz.cx> p4raw-id: //depot/perl@34831
* Update copyright years.Nicholas Clark2008-10-251-2/+1
| | | p4raw-id: //depot/perl@34585
* Add SV allocation tracing to -Dm and PERL_MEM_LOGMarcus Holland-Moritz2008-10-241-0/+4
| | | | | Message-ID: <20081022013731.23b5a2e5@r2d2> p4raw-id: //depot/perl@34568
* As best as I (and my minion, gcc -Os) can tell, PL_curcop andNicholas Clark2008-02-221-2/+2
| | | | | | PL_in_eval do not need to be volatile. This improves the generated code measurably - for example toke.o is 1.5% smaller. Every little helps. p4raw-id: //depot/perl@33355
* Pack the recycled pad offsets into an SV at PL_regex_pad[0]. This willNicholas Clark2008-01-111-1/+2
| | | | | use less memory than an AV. p4raw-id: //depot/perl@32959
* Note the U8 sized space created by removing -P, and check that it isNicholas Clark2008-01-111-1/+1
| | | | | now an illegal command line flag. p4raw-id: //depot/perl@32956
* Remove the -P switchRafael Garcia-Suarez2008-01-111-1/+0
| | | p4raw-id: //depot/perl@32954
* Better descriptions for PL_regex_pad and PL_regex_padav.Nicholas Clark2008-01-101-3/+6
| | | p4raw-id: //depot/perl@32944
* make miniperl -Wwrite-strings cleanRobin Barker2007-12-201-1/+1
| | | | | | From: "Robin Barker" <Robin.Barker@npl.co.uk> Message-ID: <46A0F33545E63740BC7563DE59CA9C6D09399A@exchsvr2.npl.ad.local> p4raw-id: //depot/perl@32681
* mod_perl is special, and assigns meaning to a perl_destruct_level ofNicholas Clark2007-12-031-1/+2
| | | | | | | -1. Really this should be I8, but it turns out that Configure's choice of type for I8 is buggy - it always uses char, which is unsigned on some platforms. p4raw-id: //depot/perl@32561
* Remove (probably) the last vestige of the assertions implementation -Nicholas Clark2007-11-241-2/+0
| | | | | a now unused variable. p4raw-id: //depot/perl@32477
* Bug fix for storing shared objects in shared structuresJerry D. Hedden2007-11-081-0/+3
| | | | | | | | From: "Jerry D. Hedden" <jdhedden@cpan.org> Message-ID: <1ff86f510711061136t52a1fe62waf384c4551612181@mail.gmail.com> (core patch only) p4raw-id: //depot/perl@32241
* "Bake" the values of PERL_REVISION, PERL_VERSION and PERL_SUBVERSIONNicholas Clark2007-11-071-0/+6
| | | | | | | | | | | into global variables (and hence a shared perl library). Additionally under MULTIPLICITY record the size of the interpreter structure (total, and for this version) and under PERL_GLOBAL_STRUCT the size of the global variables structure. Coupled with PL_bincompat_options this will allow 5.10.1 (and later), when compiled with a shared perl library, to perform sanity checks in main() to verify that the shared library is indeed binary compatible. p4raw-id: //depot/perl@32238
* Move (most of) the conditionally compiled members of the interpreterNicholas Clark2007-10-081-26/+25
| | | | | structure to the end. p4raw-id: //depot/perl@32068
* Shrink 4 bytes (ILP32) from the interpreter structure.Nicholas Clark2007-10-081-10/+9
| | | | | | | (Spotted a U8 sized hole, and filled the known U16 sized hole). Moved the sig_pending so that its int fills the 4 byte space left by csh_len, to reduce padding on LP64. p4raw-id: //depot/perl@32067
* PL_cshname is actually a constant value known at compile time.Nicholas Clark2007-10-051-5/+0
| | | | | | | PL_cshlen can be calculated by the compiler. So eliminate both as interpreter variables, and the code that calculates PL_cshlen at runtime. p4raw-id: //depot/perl@32035
* Reverse change #31978Rafael Garcia-Suarez2007-10-031-8/+2
| | | | | p4raw-link: @31978 on //depot/perl: d804f4346b490171e547d5cc512063e53da10708 p4raw-id: //depot/perl@32015
* Move the bool v_string_ok into the U16-sized gap in the interpreterNicholas Clark2007-09-271-3/+7
| | | | | | structure. Add a "spare" variable so that we can add the first post- 5.10.0 bool variable without growing the interpreter structure. p4raw-id: //depot/perl@31987
* RE: [PATCH] use 5.010 is ugly; use 5.10.0 warnsRobin Barker2007-09-261-1/+3
| | | | | | From: "Robin Barker" <Robin.Barker@npl.co.uk> Message-ID: <2C2E01334A940D4792B3E115F95B7226C9D1C3@exchsvr1.npl.ad.local> p4raw-id: //depot/perl@31978
* Note the gotcha about newlines in the elements of PL_preambleav.Nicholas Clark2007-09-151-0/+4
| | | p4raw-id: //depot/perl@31871
* enable utf8 cache assertions on DEBUGGING buildsDave Mitchell2007-09-141-1/+1
| | | p4raw-id: //depot/perl@31868
* change #31246 unconditionally enabled utf8 cache debugging codeDave Mitchell2007-09-101-1/+1
| | | | | p4raw-link: @31246 on //depot/perl: 95ca8690fb514421b98da534c91bfd455c9daabc p4raw-id: //depot/perl@31842