Skip to content

Commit

Permalink
Merge branch 'cursor-mem-opts' of github.com:perl6/nqp
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed Nov 26, 2013
2 parents 7f7d915 + 3b28064 commit ef756d4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/QRegex/Cursor.nqp
Expand Up @@ -85,7 +85,15 @@ role NQPCursorRole is export {
}
$csi++;
}
}
}

# Once we've produced the captures, and if we know we're finished and
# will never be backtracked into, we can release cstack and regexsub.
unless nqp::defined($!bstack) {
$!cstack := nqp::null();
$!regexsub := nqp::null();
}

$caps;
}

Expand Down Expand Up @@ -212,8 +220,10 @@ role NQPCursorRole is export {
}

method !cursor_fail() {
$!match := nqp::null();
$!bstack := nqp::null();
$!match := nqp::null();
$!bstack := nqp::null();
$!cstack := nqp::null();
$!regexsub := nqp::null();
$!pos := -3;
}

Expand Down
3 changes: 3 additions & 0 deletions src/QRegex/P6Regex/Actions.nqp
Expand Up @@ -729,6 +729,9 @@ class QRegex::P6Regex::Actions is HLL::Actions {
)
)
)));
if %*RX<r> {
$qast[2].backtrack('r');
}
$block.push($qast);

$block;
Expand Down

0 comments on commit ef756d4

Please sign in to comment.