remove jit stack

This commit is contained in:
Jabasukuriputo Wang
2022-09-05 17:00:14 +08:00
committed by GitHub
parent 0d81b636be
commit 6518973464
4 changed files with 11 additions and 27 deletions

View File

@@ -36,8 +36,6 @@ namespace operators {
VerifyCC::~VerifyCC() {
#if WITH_PCRE2
pcre2_code_free(m_pc);
pcre2_match_context_free(m_pmc);
pcre2_jit_stack_free(m_pcjs);
#else
if (m_pc != NULL) {
pcre_free(m_pc);
@@ -107,11 +105,7 @@ bool VerifyCC::init(const std::string &param2, std::string *error) {
if (m_pc == NULL) {
return false;
}
m_pcje = pcre2_jit_compile(m_pc, PCRE2_JIT_COMPLETE);
m_pmc = pcre2_match_context_create(NULL);
m_pcjs = pcre2_jit_stack_create(32*1024, 512*1024, NULL);
pcre2_jit_stack_assign(m_pmc, NULL, m_pcjs);
#else
const char *errptr = NULL;
int erroffset = 0;
@@ -153,9 +147,9 @@ bool VerifyCC::evaluate(Transaction *t, RuleWithActions *rule,
for (offset = 0; offset < target_length; offset++) {
if (m_pcje == 0) {
ret = pcre2_jit_match(m_pc, pcre2_i, target_length, offset, 0, match_data, m_pmc);
ret = pcre2_jit_match(m_pc, pcre2_i, target_length, offset, 0, match_data, NULL);
} else {
ret = pcre2_match(m_pc, pcre2_i, target_length, offset, 0, match_data, m_pmc);
ret = pcre2_match(m_pc, pcre2_i, target_length, offset, 0, match_data, NULL);
}
/* If there was no match, then we are done. */

View File

@@ -53,9 +53,7 @@ class VerifyCC : public Operator {
private:
#if WITH_PCRE2
pcre2_code *m_pc;
pcre2_match_context *m_pmc;
int m_pcje;
pcre2_jit_stack *m_pcjs;
#else
pcre *m_pc;
pcre_extra *m_pce;