updated for version 7.3.1149
Problem: New regexp engine: Matching plain text could be faster.
Solution: Detect a plain text match and handle it specifically. Add
vim_regfree().
diff --git a/src/syntax.c b/src/syntax.c
index 323889e..a8de63a 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -3495,7 +3495,7 @@
block->b_syn_sync_maxlines = 0;
block->b_syn_sync_linebreaks = 0;
- vim_free(block->b_syn_linecont_prog);
+ vim_regfree(block->b_syn_linecont_prog);
block->b_syn_linecont_prog = NULL;
vim_free(block->b_syn_linecont_pat);
block->b_syn_linecont_pat = NULL;
@@ -3544,7 +3544,7 @@
curwin->w_s->b_syn_sync_maxlines = 0;
curwin->w_s->b_syn_sync_linebreaks = 0;
- vim_free(curwin->w_s->b_syn_linecont_prog);
+ vim_regfree(curwin->w_s->b_syn_linecont_prog);
curwin->w_s->b_syn_linecont_prog = NULL;
vim_free(curwin->w_s->b_syn_linecont_pat);
curwin->w_s->b_syn_linecont_pat = NULL;
@@ -3583,7 +3583,7 @@
int i;
{
vim_free(SYN_ITEMS(block)[i].sp_pattern);
- vim_free(SYN_ITEMS(block)[i].sp_prog);
+ vim_regfree(SYN_ITEMS(block)[i].sp_prog);
/* Only free sp_cont_list and sp_next_list of first start pattern */
if (i == 0 || SYN_ITEMS(block)[i - 1].sp_type != SPTYPE_START)
{
@@ -4991,7 +4991,7 @@
/*
* Something failed, free the allocated memory.
*/
- vim_free(item.sp_prog);
+ vim_regfree(item.sp_prog);
vim_free(item.sp_pattern);
vim_free(syn_opt_arg.cont_list);
vim_free(syn_opt_arg.cont_in_list);
@@ -5248,7 +5248,7 @@
{
if (!success)
{
- vim_free(ppp->pp_synp->sp_prog);
+ vim_regfree(ppp->pp_synp->sp_prog);
vim_free(ppp->pp_synp->sp_pattern);
}
vim_free(ppp->pp_synp);
@@ -6022,7 +6022,7 @@
id = -1; /* remember that we found one */
}
}
- vim_free(regmatch.regprog);
+ vim_regfree(regmatch.regprog);
}
}
vim_free(name);
@@ -6295,7 +6295,7 @@
curwin->w_p_spell = FALSE; /* No spell checking */
clear_string_option(&curwin->w_s->b_p_spc);
clear_string_option(&curwin->w_s->b_p_spf);
- vim_free(curwin->w_s->b_cap_prog);
+ vim_regfree(curwin->w_s->b_cap_prog);
curwin->w_s->b_cap_prog = NULL;
clear_string_option(&curwin->w_s->b_p_spl);
#endif