From bc5191c7bcfb7df191cbe411882eab9a1c71e518 Mon Sep 17 00:00:00 2001 From: Valentin Bartenev Date: Mon, 26 Dec 2011 13:10:36 +0000 Subject: Added support for regex study and PCRE JIT (ticket #41) optimizations on configuration phase. --- src/core/ngx_regex.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/core/ngx_regex.h') diff --git a/src/core/ngx_regex.h b/src/core/ngx_regex.h index fc35059b3..52d059e5c 100644 --- a/src/core/ngx_regex.h +++ b/src/core/ngx_regex.h @@ -18,7 +18,11 @@ #define NGX_REGEX_CASELESS PCRE_CASELESS -typedef pcre ngx_regex_t; + +typedef struct { + pcre *pcre; + pcre_extra *extra; +} ngx_regex_t; typedef struct { @@ -45,7 +49,7 @@ void ngx_regex_init(void); ngx_int_t ngx_regex_compile(ngx_regex_compile_t *rc); #define ngx_regex_exec(re, s, captures, size) \ - pcre_exec(re, NULL, (const char *) (s)->data, (s)->len, 0, 0, \ + pcre_exec(re->pcre, re->extra, (const char *) (s)->data, (s)->len, 0, 0, \ captures, size) #define ngx_regex_exec_n "pcre_exec()" -- cgit