aboutsummaryrefslogtreecommitdiffstats
path: root/regint.h
diff options
context:
space:
mode:
authorTSUYUSATO Kitsune <make.just.on@gmail.com>2023-05-04 13:15:51 +0900
committerGitHub <noreply@github.com>2023-05-04 13:15:51 +0900
commitac730d3e759207fd0ea7289815985ee867689b9c (patch)
tree45fb75cd4388d92c0847a54f5bd66fc133483e50 /regint.h
parent18b27185c37378c65fee12091c5ff90d5be2ec97 (diff)
downloadruby-ac730d3e759207fd0ea7289815985ee867689b9c.tar.gz
Delay start of the match cache optimization (#7738)
Diffstat (limited to 'regint.h')
-rw-r--r--regint.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/regint.h b/regint.h
index a91870bfaa..650d615c64 100644
--- a/regint.h
+++ b/regint.h
@@ -909,7 +909,7 @@ typedef struct {
uint64_t end_time;
#endif
#ifdef USE_MATCH_CACHE
- int enable_match_cache;
+ int match_cache_status;
long num_fails;
long num_cache_opcodes;
OnigCacheOpcode* cache_opcodes;
@@ -918,8 +918,13 @@ typedef struct {
#endif
} OnigMatchArg;
+#define NUM_CACHE_OPCODES_UNINIT 1
#define NUM_CACHE_OPCODES_IMPOSSIBLE -1
-#define NUM_CACHE_OPCODES_UNINIT -2
+
+#define MATCH_CACHE_STATUS_UNINIT 1
+#define MATCH_CACHE_STATUS_INIT 2
+#define MATCH_CACHE_STATUS_DISABLED -1
+#define MATCH_CACHE_STATUS_ENABLED 0
#define IS_CODE_SB_WORD(enc,code) \
(ONIGENC_IS_CODE_ASCII(code) && ONIGENC_IS_CODE_WORD(enc,code))