aboutsummaryrefslogtreecommitdiffstats
path: root/regint.h
diff options
context:
space:
mode:
Diffstat (limited to 'regint.h')
-rw-r--r--regint.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/regint.h b/regint.h
index b136d804dc..0e9777cc1e 100644
--- a/regint.h
+++ b/regint.h
@@ -148,7 +148,13 @@
#ifdef RUBY
-# define CHECK_INTERRUPT_IN_MATCH_AT rb_thread_check_ints()
+# define CHECK_INTERRUPT_IN_MATCH_AT do { \
+ msa->counter++; \
+ if (msa->counter >= 128) { \
+ msa->counter = 0; \
+ rb_thread_check_ints(); \
+ } \
+} while(0)
# define onig_st_init_table st_init_table
# define onig_st_init_table_with_size st_init_table_with_size
# define onig_st_init_numtable st_init_numtable
@@ -870,6 +876,7 @@ typedef struct {
void* state_check_buff;
int state_check_buff_size;
#endif
+ int counter;
} OnigMatchArg;