summaryrefslogtreecommitdiff
path: root/scope.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 /scope.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 'scope.c')
-rw-r--r--scope.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/scope.c b/scope.c
index 5c34a49499..2a9b3d5401 100644
--- a/scope.c
+++ b/scope.c
@@ -1136,9 +1136,6 @@ Perl_leave_scope(pTHX_ I32 base)
- SAVESTACK_ALLOC_FOR_RE_SAVE_STATE);
PL_savestack_ix -= SAVESTACK_ALLOC_FOR_RE_SAVE_STATE;
- if (PL_reg_start_tmp != state->re_state_reg_start_tmp) {
- Safefree(PL_reg_start_tmp);
- }
if (PL_reg_poscache != state->re_state_reg_poscache) {
Safefree(PL_reg_poscache);
}