diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-09-07 07:21:02 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-09-07 07:21:02 -0700 |
commit | a31ad16733b6da5a45803a9482e330d17f690636 (patch) | |
tree | 4bc8f872f823a0020652c6c6fe86c697982ec7a7 /regex.c | |
parent | dcc75348c720acd6c2a0587bca34f7851e6c1283 (diff) | |
download | txr-a31ad16733b6da5a45803a9482e330d17f690636.tar.gz txr-a31ad16733b6da5a45803a9482e330d17f690636.tar.bz2 txr-a31ad16733b6da5a45803a9482e330d17f690636.zip |
Don't use prot1 for temporary gc protection.
* lib.c (split_str, split_str_set, list_str, int_str): Use
gc_hint rather than prot1/rel1. More efficient, doesn't
use space in the prot_stack array.
* regex.c (search_regex): Likewise.
* stream.c (vformat_str, formatv, run): Likewise.
In formatv, rel1 wasn't being called in the uw_unwind
block, so this fixes a bug.
Diffstat (limited to 'regex.c')
-rw-r--r-- | regex.c | 4 |
1 files changed, 1 insertions, 3 deletions
@@ -1981,8 +1981,6 @@ val search_regex(val haystack, val needle_regex, val start, cnum s = c_num(start); const wchar_t *h = c_str(haystack); - prot1(&haystack); - for (i = c_num(length_str(haystack)) - 1; i >= s; i--) { cnum span = regex_run(needle_regex, h + i); if (span >= 0) { @@ -1991,7 +1989,7 @@ val search_regex(val haystack, val needle_regex, val start, } } - rel1(&haystack); + gc_hint(haystack); } else { regex_machine_t regm; val i, pos = start, retval; |