summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2012-05-15 21:01:39 +0100
committerDavid Mitchell <davem@iabyn.com>2012-06-13 13:32:53 +0100
commitb3fd53f35858a4ca5c7226ba0fa5a9e864378c38 (patch)
tree760a9af83086fb9a5c529c6a50974adbb1d1bf11 /perl.c
parentb93070ed2e35b0430327cc866a4fcf4042014513 (diff)
downloadperl-b3fd53f35858a4ca5c7226ba0fa5a9e864378c38.tar.gz
eliminate PL_reg_start_tmp, PL_reg_start_tmpl
PL_reg_start_tmp is a global array of temporary parentheses start positions. An element is set when a '(' is first encountered, while when a ')' is seen, the per-regex offs array is updated with the start and end position: the end derived from the position where the ')' was encountered, and the start position derived from PL_reg_start_tmp[n]. This allows us to differentiate between pending and fully-processed captures. Change it so that the tmp start value becomes a third field in the offs array (.start_tmp), along with the existing .start and .end fields. This makes the value now per regex rather than global. Although it uses a bit more memory (the start_tmp values aren't needed after the match has completed), it simplifies the code, and will make it easier to make a (??{}) switch to the new regex without having to dump everything on the save stack.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/perl.c b/perl.c
index c56179957d..f7f6c2b915 100644
--- a/perl.c
+++ b/perl.c
@@ -1236,9 +1236,6 @@ perl_destruct(pTHXx)
Safefree(PL_origfilename);
PL_origfilename = NULL;
- Safefree(PL_reg_start_tmp);
- PL_reg_start_tmp = (char**)NULL;
- PL_reg_start_tmpl = 0;
Safefree(PL_reg_curpm);
Safefree(PL_reg_poscache);
free_tied_hv_pool();